views:

79

answers:

1

I am using struts2 (2.1.6) and want to redirect to Action2 from Action1.

struts.xml:

<action name="Action1" class="Action1">
    <result name="success" type="redirectAction">Action2</result>
</action>

<action name="Action2" class="Action2">
    <result name="success">/demo.jsp</result>
</action>

This works as expected: http://myserver:9064/demo/Action1 redirects to http://myserver:9064/demo/Action2 (tested on tomcat and websphere).

But when I put my app behind BigIP, redirectAction no longer behaves as expected.

http://mybigip/demo/Action1 is expected to redirect to http://mybigip/demo/Action2, instead it redirects to http://mybigip:9064/demo/Action2 (note that my app's port number gets appended) which gives a 404 error. I got same result for type="redirect" also.

Any pointer to solve this issue would be much appreciated.

A: 

I found the solution for this problem. In fact this is not happening just for Struts. It happens in general with any Response.sendRedirect or RequestDispatcher.forward. Also, this behavior is noticed when the app is deployed in WebSphere and not when in Tomcat.

The links below has more details:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rweb_custom_props.html
(look for the custom property httpsIndicatorHeader)

Also:

http://support.f5.com/kb/en-us/solutions/public/1000/800/sol1871.html
Somu