You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Phillips <ph...@post.queensu.ca> on 2004/09/08 03:19:33 UTC

logic:redirect has odd behavior in HW load balanced struts app

Hi.

We have been experiencing odd behavior with the logic:redirect tag where a
simple index.jsp page that contains it seems to construct absolute urls
instead of relative ones, which is not what we would like.  We hope that by
sending the question out to the list that we could get some clarification on
the use of the tag.

The index.jsp that kicks off our applications contains:

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect forward="intro"/>

Which results in an absolute fully qualified url being generated for the
redirect.

This is all fine and dandy when you have a single server, but we are now in
a clustered environment behind hardware load balancers which respond to the
request and route traffic to internal servers.

The problem is that the absolute url generated by the above tag on internal
servers results in the internal servers protocol, port, server name being
used which is *not* what we want.
We just want a relative url for the redirect.  We use the hardware load
balancers to perform SSL to the browser, and have non ssl traffic to the
internal servers.  This means that the protocols are mismatched (http
instead of https), the server name is mismatched (inside-servername appears,
not the external one), and so is the port (1234 instead of ssl's 443).

For example the internal servers absolute redirect looks like:
http://inside-servername:1234/intro.do;jsessionid=abc_etc

This results in a bad request since it is not an externally routable name by
design, the protocol is mismatched and so are the ports.

When we want it to REALLY be is:		/intro.do;jsessionid=abc_etc

So the outside world sees it through the hardware loadbalancer as:
https://outside-servername:443/intro.do:jsessionid=abc_etc

We think that the redirect SHOULD be relative, but it certainly doesn't seem
that way.

Can any one shed light on this? 

Our platform details are:
Struts 1.1
Cluster of Oracle 10g j2ee app servers

(we have tested on a single server with no HW load balancing and can
replicate the same behavior) 

Look forward to hearing your comments...

Chris...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: logic:redirect has odd behavior in HW load balanced struts app

Posted by James Mitchell <jm...@apache.org>.
This is actually a side affect of your container configuration (or
limitation).  If your container supports it, you can override it.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

----- Original Message -----
From: "Chris Phillips" <ph...@post.queensu.ca>
To: <us...@struts.apache.org>
Sent: Tuesday, September 07, 2004 9:19 PM
Subject: logic:redirect has odd behavior in HW load balanced struts app


Hi.

We have been experiencing odd behavior with the logic:redirect tag where a
simple index.jsp page that contains it seems to construct absolute urls
instead of relative ones, which is not what we would like.  We hope that by
sending the question out to the list that we could get some clarification on
the use of the tag.

The index.jsp that kicks off our applications contains:

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect forward="intro"/>

Which results in an absolute fully qualified url being generated for the
redirect.

This is all fine and dandy when you have a single server, but we are now in
a clustered environment behind hardware load balancers which respond to the
request and route traffic to internal servers.

The problem is that the absolute url generated by the above tag on internal
servers results in the internal servers protocol, port, server name being
used which is *not* what we want.
We just want a relative url for the redirect.  We use the hardware load
balancers to perform SSL to the browser, and have non ssl traffic to the
internal servers.  This means that the protocols are mismatched (http
instead of https), the server name is mismatched (inside-servername appears,
not the external one), and so is the port (1234 instead of ssl's 443).

For example the internal servers absolute redirect looks like:
http://inside-servername:1234/intro.do;jsessionid=abc_etc

This results in a bad request since it is not an externally routable name by
design, the protocol is mismatched and so are the ports.

When we want it to REALLY be is: /intro.do;jsessionid=abc_etc

So the outside world sees it through the hardware loadbalancer as:
https://outside-servername:443/intro.do:jsessionid=abc_etc

We think that the redirect SHOULD be relative, but it certainly doesn't seem
that way.

Can any one shed light on this?

Our platform details are:
Struts 1.1
Cluster of Oracle 10g j2ee app servers

(we have tested on a single server with no HW load balancing and can
replicate the same behavior)

Look forward to hearing your comments...

Chris...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org