Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
6.0.0
-
None
Description
Action a:
public String a() { request.getRequestDispatcher("/b.action").forward(request, response); return null; }
Action b:
public String b() { ... }
When the user calls /a.action, it is automatically forwarded to b.action. These codes work well in Struts 2.5.x version.
After upgrading to the 6.0.0 version, code like the above will cause an infinite loop issue.
In Struts 6.0.0, code like "actionA->forward->actionB" will cause infinite loop issue.
This issue also exists when using ServletDispatcherResult to initiate a forward request:
<result name="success" type="dispatcher"> <param name="location">b.action</param> </result>
This issue related to #179 pull request.
ActionInvocation invocation = ActionContext.getContext().getActionInvocation(); if (invocation == null || invocation.isExecuted()) { // *The code here doesn't handle the servlet forward case* proxy=getContainer().getInstance(ActionProxyFactory.class).createActionProxy(namespace, name, method, extraContext, true, false); } else { proxy=invocation.getProxy(); }
Once this problem occurs, the jvm process consumes a lot of CPU resources, and there is no log to troubleshoot.
I don't know much about how Struts internals work, is there any workaround other than delayed upgrade to Struts 6.x version?
Attachments
Issue Links
- duplicates
-
WW-5190 StackOverflowError when dispatching to JSP
- Closed