Note that there are some explanatory texts on larger screens.

plurals
  1. POScope Interceptor Struts 2: back button behaviour
    primarykey
    data
    text
    <p>I want to implement a wizard like functionality in my Struts2(2.2.3.1) application using Scope interceptor.</p> <p>My struts.xml file is as follows:</p> <pre><code>&lt;action name="actionA class="classA" method="methodA"&gt; &lt;interceptor-ref name="basicStack" /&gt; &lt;interceptor-ref name="scope"&gt; &lt;param name="session"&gt;stringA&lt;/param&gt; &lt;param name="key"&gt;consultGuides&lt;/param&gt; &lt;param name="type"&gt;start&lt;/param&gt; &lt;/interceptor-ref&gt; &lt;result&gt;/resultA.jsp&lt;/result&gt; &lt;/action&gt; &lt;action name="actionB" class="classA" method="methodB"&gt; &lt;interceptor-ref name="scope"&gt; &lt;param name="session"&gt;stringA, listA&lt;/param&gt; &lt;param name="key"&gt;consultGuides&lt;/param&gt; &lt;/interceptor-ref&gt; &lt;interceptor-ref name="basicStack" /&gt; &lt;result&gt;/resultB.jsp&lt;/result&gt; &lt;/action&gt; .... .... </code></pre> <p>"resultA.jsp" submits to"actionB" populating the "listA". But now if I press the back button(reaching resultA.jsp, where resultA.jsp is just loaded to the browser from its cache without making a new request to the server) and make any changes to the list, the new entries are appended to "listA" instead of entirely replacing it.</p> <p>The code in 'resultA.jsp' that modifies 'listA' is </p> <pre><code>&lt;s:iterator value="listB" status="statusB"&gt; &lt;li&gt; &lt;a title="%{varA}"&gt; &lt;s:checkbox name="listA.id" fieldValue="%{varB}" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;/s:iterator&gt; </code></pre> <p>I am not implementing SessionAware and just relying on the scopeInterceptor to feed listA to the session. </p> <p>How can I make it replace the "listA" with the new list in the request? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload