You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wazzaly Ioo <wa...@gmail.com> on 2010/03/04 16:07:01 UTC

How to keep mounted bookmarkable urls after an onclick?

Hello,

I'm new to Wicket and have to change an existing Wicket 1.4.5 application.

A requirement is that some pages must have an url that starts with
/restricted/ after the context root. For example
https://www.domain.com/context-root/restricted/easy-to-remember

This is done by mounting bookmarkable pages to urls. We do this with:
org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
Class<T>);
we call application.mountBookmarkablePage("/restricted/easy-to-remember",
SomePage.class);

This works, but there is one problem:
if the onclick event on a component on the page is fired, then the url gets
something like: https://www.domain.com/context-root/?wicket:interface=:5:1:
::
instead of
https://www.domain.com/context-root/restricted/another-easy-to-remember-path/?wicket:interface=:5:1:
::

How can I fix this problem?

Thanks,

Wazzaly

Re: How to keep mounted bookmarkable urls after an onclick?

Posted by wazzaly Ioo <wa...@gmail.com>.
Thnx for your very fast reply. And even more for the correct solution! :-)

On Thu, Mar 4, 2010 at 4:08 PM, Jeremy Thomerson
<je...@wickettraining.com>wrote:

> Try using the HybridUrlEncodingStrategy
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Thu, Mar 4, 2010 at 9:07 AM, wazzaly Ioo <wa...@gmail.com> wrote:
>
> > Hello,
> >
> > I'm new to Wicket and have to change an existing Wicket 1.4.5
> application.
> >
> > A requirement is that some pages must have an url that starts with
> > /restricted/ after the context root. For example
> > https://www.domain.com/context-root/restricted/easy-to-remember
> >
> > This is done by mounting bookmarkable pages to urls. We do this with:
> >
> >
> org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> > Class<T>);
> > we call application.mountBookmarkablePage("/restricted/easy-to-remember",
> > SomePage.class);
> >
> > This works, but there is one problem:
> > if the onclick event on a component on the page is fired, then the url
> gets
> > something like:
> https://www.domain.com/context-root/?wicket:interface=:5:1
> > :
> > ::
> > instead of
> >
> >
> https://www.domain.com/context-root/restricted/another-easy-to-remember-path/?wicket:interface=:5:1
> > :
> > ::
> >
> > How can I fix this problem?
> >
> > Thanks,
> >
> > Wazzaly
> >
>

Re: How to keep mounted bookmarkable urls after an onclick?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Try using the HybridUrlEncodingStrategy

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Mar 4, 2010 at 9:07 AM, wazzaly Ioo <wa...@gmail.com> wrote:

> Hello,
>
> I'm new to Wicket and have to change an existing Wicket 1.4.5 application.
>
> A requirement is that some pages must have an url that starts with
> /restricted/ after the context root. For example
> https://www.domain.com/context-root/restricted/easy-to-remember
>
> This is done by mounting bookmarkable pages to urls. We do this with:
>
> org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String,
> Class<T>);
> we call application.mountBookmarkablePage("/restricted/easy-to-remember",
> SomePage.class);
>
> This works, but there is one problem:
> if the onclick event on a component on the page is fired, then the url gets
> something like: https://www.domain.com/context-root/?wicket:interface=:5:1
> :
> ::
> instead of
>
> https://www.domain.com/context-root/restricted/another-easy-to-remember-path/?wicket:interface=:5:1
> :
> ::
>
> How can I fix this problem?
>
> Thanks,
>
> Wazzaly
>