Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 16th, 2012  |  syntax: None  |  size: 0.66 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. wicket: mapping different paths to the same class on request to generate different content in markup
  2. public IRequestHandler mapRequest(Request request) {
  3.                 if(compatibilityScore>0) {
  4.                     PageProvider provider = new PageProvider(ItemDetailPage.class, new ItemIDUrlParam(request.getUrl().getPath().split("/")[1]));
  5.                     provider.setPageSource(Application.get().getMapperContext());
  6.                     return new RenderPageRequestHandler(provider);
  7.                 }
  8.                 return null;
  9.             }
  10.        
  11. mountPage("/shop/${id}", ShopDetailPage.class);
  12.        
  13. mountPage("/shop/${id}/${title}", ShopDetailPage.class);