Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public void onSubmit()
{
{panel}
    // [...]
{panel}

{panel}
    // Tell Wicket we're going to do the redirect ourselves.
    getRequestCycle().setRedirect(false);
{panel}

{panel}
    // Make sure no output for the current cycle is ever sent.
    getRequestCycle().setRequestTarget(EmptyRequestTarget.getInstance());
{panel}

{panel}
    // The HTTP RFC says redirects should always be absolute, so we
    // make an absolute path by prefixing with the context path.
    String contextPath = getApplication().getApplicationSettings().getContextPath();
    getResponse().redirect(contextPath + "/path/to/legacyJspFile.jsp");
{panel}
}

Note that if you just want to make standard anchor tag links to other pages, don't create a Link and use this method in the onClick() handler; instead use the ExternalLink class.