Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Did you know you can define page class alias to not expose your package structure in the URL? Just use application.getPages().putClassAlias(MyPage.class, "myAlias"); The URL will than look like http://.../myApp?bookmarkablePage=myAlias

Absolute paths

Code Block

RequestUtils.toAbsolutePath(urlFor(...));

Absolute paths with Wicket > 1.5

THe RequestUtils method with only one parameter has been removed. To get the same output, it is recommended to use the following code:

Code Block

RequestCycle.get().getUrlRenderer().renderFullUrl(
   Url.parse(urlFor(MyPage.class,null).toString()));

If you would like to work in a similar way as before 1.5, you can use the following method:

Code Block

public final static String toAbsolutePath(final String relativePagePath) {
       HttpServletRequest req = (HttpServletRequest)((WebRequest)RequestCycle.get().getRequest()).getContainerRequest();
       return RequestUtils.toAbsolutePath(req.getRequestURL().toString(), relativePagePath);
}