Struts2 Infinite recursion detected
<p>I have a struts2 chain result that redirects to itself but it does NOT create an infinite loop because there is a condition that will eventually evaluate to false and then the recursion will stop. I have to use chain instead of redirectAction because I need a POST request which redirectAction cannot do.</p>

<p>This is the exception I'm getting</p>

<pre><code>Could not execute action
Infinite recursion detected: [/view/myAction!myMethod, /view/myAction, /view/myAction] - [unknown location]
    at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:214)
</code></pre>

<p>I have been through the xwork jar where the infinite loop detection is based. It looks at the chain history and if it finds the action name it throws an exception. The maximum recursion is hardcoded to 1.</p>

<p>Is there a way to handle the exception or increase the maximum number of allowed recursions or reset the chain history manually while chaining? </p>