title: Wicket redirect: how to pass on parameters and keeps URLs "pretty"?
body: <p>Consider a Wicket WebPage that redirects to another page (based on some logic omitted from here):</p>
  <pre><code>public class SomePage extends WebPage {
      public SomePage(PageParameters parameters) {
          setResponsePage(AnotherPage.class);
          setRedirect(true);
      }
  }
  </code></pre>
  <p>I need to pass on the PageParameters to that other page, and this seems to be the way to do that:</p>
  <pre><code>setResponsePage(new AnotherPage(parameters));
  </code></pre>
  <p>However, when creating a new Page object like this, I end up at an URL such as <code>/?wicket:interface=:1::::</code> instead of the clean <code>/another</code>. AnotherPage is defined as:</p>
  <pre><code>@MountPath(path = &quot;another&quot;)
  public class AnotherPage extends WebPage {
      // ...
  }
  </code></pre>
  <p>(Where MountPath is from org.wicketstuff.annotation.mount package.)</p>
  <p>So, my questions are:</p>
  <ul>
  <li>Some other way to pass on the params?</li>
  <li>Some way to keep the URL pretty? Is the above a Wicket Stuff specific limitation instead of core Wicket?</li>
  </ul>
  <h3>Update</h3>
  <p>Heh, turns out <em>any</em> of the suggested approaches work, and <strong>also</strong> what I originally tried — <code>setResponsePage(new AnotherPage(parameters))</code> — as long as I remove <code>setRedirect(true)</code>. The URL does stay the same (path to SomePage) in that case, and <strong>I just realised</strong> I really should have mentioned right from the start that it's okay if it does (as long as it's &quot;pretty&quot; and the parameters are passed)!</p>
  <p>The page (&quot;SomePage&quot;) dispatches requests, based on query params, to a couple of possible result pages that look different but that are accessed through the same url. I tried to formulate the question as generic and minimalist as possible, but that went awry as I left out relevant info. :-/</p>
  <p>Sorry if this ended up weird, unclear or useless for others. If you have a suggestion about renaming it, feel free to comment.</p>