I am using Wicket 6.1 and I am trying to figure out how to make my page streams more attractive, more classified URLs.
I use safe type constructors a lot, so my code will look something like this:
class SearchResultsPage extends WebPage { public SearchResultsPage(SearchResultsModel model) {
To go to the page, I have this code:
AjaxButton ajaxButton = new IndicatingAjaxButton("ajaxbutton") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { SearchResultsModel results = search(kriteriamodel) getRequestCycle().setResponsePage(new SearchResultsPage(results)); } @Override protected void onError(AjaxRequestTarget target, Form<?> form) { target.add(feedback); } };
Now, when I get to the results page, will my URL look something like searchresults? 5
I would like to be able to encode the search parameters into a URL that the user could add for a subsequent referral.
I know that I can use the PageParameters map and manually map my objects to and from this structure. But I'm looking for a more elegant solution.
- I'm looking for pointers to some kind of smart interface that my page or model needs to implement in order to make the page more bookmarked.
- An example would be nice.
- Ideally, only the code in Page / Model should be changed.
Thanks.
source share