开发者

Problem with struts2 redirectAction result when using BigIP

开发者 https://www.devze.com 2023-01-16 03:15 出处:网络
I am using struts2 (2.1.6) and want to redirect to Action2 from Action1. struts.xml: <action name=\"Action1\" class=\"Action1\">

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 wor开发者_运维问答ks 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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消