Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You used the word "forward" but it sounds like you want to go to a new page (address.html) to collect more information about the address. If this is the case, you need to redirect to the address page after the user action completes.</p> <pre><code>&lt;action name="user" class="UserAction"&gt; &lt;!-- Redirect to another namespace --&gt; &lt;!-- for Struts 2.2 --&gt; &lt;result type="redirectAction"&gt; &lt;!-- for Struts 2.0 &lt;result type="redirect-action"&gt; --&gt; &lt;param name="actionName"&gt;collect-address&lt;/param&gt; &lt;param name="userId"&gt;${userId}&lt;/param&gt; &lt;/result&gt; &lt;/action&gt; </code></pre> <p>The ${userId} syntax will call getUserId on your UserAction and pass that parameter as you showed in your question: addressForm.html?user_id=X. collect-address can have a success result that goes to addressForm.html. <a href="http://struts.apache.org/2.0.6/docs/redirect-action-result.html" rel="noreferrer">Docs here.</a> If you want to avoid using another action, you can try <a href="http://struts.apache.org/2.0.6/docs/redirect-result.html" rel="noreferrer">using the result type="redirect"</a> and pass things through that way.</p> <p>If you really want to forward, you can use <a href="http://struts.apache.org/2.0.6/docs/action-chaining.html" rel="noreferrer">action chaining</a>. This is <a href="http://www.mail-archive.com/user@struts.apache.org/msg53168.html" rel="noreferrer">discouraged by Ted Husted on the Struts2 team</a> but it may work for you.</p> <p>Instead of action chaining, try to bring all the code to complete this request into a single action and use helper or service classes for User and Address to separate and reuse the code instead of "action chaining".</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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