Multiple Markups Per Page
With wicket, every html markup page is controlled by a Class file, a panel, etc. It does make sense at times to have a single class file manage multiple markup files, or "variations" in Wicket land. You can do so using the following code in the Page:
public MyPage(PageParameters parameters) { if(parameters!=null) { this.variant = (String)parameters.get("variant"); } } private String variant; public String getVariation() { return variant; }
Where variant is passed in as a request parameter, so a request to /MyPage?variant=abc
would retrieve MyPage_abc.html
and /MyPage?variant=xyz
would retrieve MyPage_xyz.html
.