Wicket has an feature to automatically convert static references in the HTML markup to dynamic links.

To only convert some references to dynamic links, surround the HTML markup parts by <wicket:link>...</wicket:link> tags:

<html>
  <head>
    <title>Title</title>
  </head>
  <body>
    <wicket:link>
      <a href="AnotherPage.html">Go to another page</a>
    </wicket:link>
  </body>
</html>

To convert all links in all markups, set the corresponding property in the markup settings:

public class OurApplication extends WebApplication {
  ...
  protected void init() {
    ...
    getMarkupSettings().setAutomaticLinking(true);
    ...
  }
  ...
}

Unfortunately, it seems not to work out-of-the-box when the reference points to static resources outside the WEB-INF/classes/ directory. For a work-around, please take a look at WICKET-581.

  • No labels