Create a class NoVersionMount:
/**
* Provides a mount strategy that drops the version number from
* stateful page urls.
*/
public class NoVersionMount extends MountedMapper {
public NoVersionMount(String path, Class<? extends
IRequestablePage> pageClass) {
super(path, pageClass, new PageParametersEncoder());
}
@Override protected void encodePageComponentInfo(Url url,
PageComponentInfo info)
{
// do nothing so that component info does not get
// rendered in url
}
@Override public Url mapHandler(IRequestHandler
requestHandler)
{
if (requestHandler instanceof
ListenerInterfaceRequestHandler) {
return null;
} else {
return super.mapHandler(requestHandler);
}
}
}
And mount your pages using that mounted mapper, e.g.:
mount(new NoVersionMount("myPage", MyPage.class));
Cheers, Gerrit
On Sun, Mar 18, 2012, at 02:51, Paolo wrote:
> Hi,
> I read this old post to solve the my same problem:
>
> -------------------------------
> I'm using Wicket 1.5.3, an application with a number of tabbed panels.
>
> My application's url is, lets say http://localhost:9080/context/
>
> When I enter this URL, the browse immediately changes this to
> http://localhost:9080/context/?0
>
> I don't want that!!
>
> When I enter userdata and switch some tabs, nothing happens, but when I
> hit
> F5 the URL changes to
> http://localhost:9080/context/?9 or another number, depending on my
> activity.
> I don't want that!!
> --------------------------------------------
> I read this suggested link:
> http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2
> http://stackoverflow.com/questions/8135755/wicket-1-5-new-urls/8139152#8139152
>
>
> BUT I DON'T UNDERSTAND TO SOLVE THE SIMPLE PROBLEM!
>
> I tried to change from
>
> String id = inparams.get("id").toString();
>
> TO
>
> RequestCycle requestCycle = RequestCycle.get();
> Request request = requestCycle.getRequest();
> IRequestParameters irp = request.getRequestParameters();
> String id = irp.getParameterValue("id").toString();
>
> BUT NOTHING CHANGED!
>
> Please Help me, in this stupid wicket issue.
>
> Thank you
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]