zuckermanori
zuckermanori

Reputation: 1755

wicket url parameters with stateful pages

on an application i develop i'm trying to keep a nice and readable url for the application's pages. i start with url as follows: http://somedomain.com/context/?param1=value&param2=value where context is the application mount path and param1 and param2 are some parameters passed to the application. the problem is that when i move to another page the url changes to be as follows: https://somedomain.com/?wicket:bookmarkablePage=:something&Title=something&group=something the way i'm moving between pages is as follows:

getRequestCycle().setResponsePage(new otherPage(obj1, obj2, pageParameters)

where obj1 and obj2 are objects required for the initialization of the page. as i understood from this post using

RequestCycle().setResponsePage(Page page)

creates a stateful page which is not bookmarkable and does not display the parameters, while using

RequestCycle().setResponsePage(Class<C> pageClass, PageParameters pageParameters)

creates a stateless page which displays the parameters. the problem is that i use the first one, as i must create the page myself so i could pass the two objects to it. is there any way to keep the url in its original bookmarkable format and remove wicket's parameters from it? i tried almost every suggestion posted on this site and others but none of them fits my case, as they suggest to let wicket create the page itself (with the second option of setResponsePage). any help will be much appreciated. thanks

Upvotes: 1

Views: 1208

Answers (1)

igor.vaynberg
igor.vaynberg

Reputation: 1453

from your url example i see you are using Wicket 1.4. I believe 1.5 will do what you want out of the box. in Wicket 1.4 you can achieve a similar result by mounting the page using HybridUrlCodingStrategy.

Upvotes: 1

Related Questions