You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gabriel Moreira <ga...@gmail.com> on 2011/06/10 16:59:31 UTC
Bookmarkable Page URL without version id param
Hi all,
I'm trying to have a bookmarkable page that functions in a way that the
version param is not printed into the URL.
The code follows like this:
Application () {
mountPage("/study", Study.class);
}
Study(PageParameters pp) {
String id = pp.get("id").toString();
... // constructs webpage
}
The problem is that when I go to:
http://localhost/study?id=A
Wicket rewrites the URL to this form:
http://localhost/study?0&id=A
If I change the id parameter, let's say, to 'id=B', it continues to display
the 0 version of that page.
Seems to be the right behaviour if the parameter was the same. Now that it
has changed its value, shouldn't have Wicket redirected me to the newer
version automatically, like this?
http://localhost/study?1&id=B
I'm running Wicket 1.5-RC1.
Is there any way to fix this, or surround this problem?
Thank you
Re: Bookmarkable Page URL without version id param
Posted by Martin Grigorov <mg...@apache.org>.
To not have the page version in the URL your page should be stateless.
See StatelessChecker from wicket-devutils to find all stateful
components in your pages.
The page version changes when there are changes in the hierarchy of
the page. By just changing the value of a request parameter this wont
happen.
Better upgrade to 1.5-RC4.2. There are many improvements.
On Fri, Jun 10, 2011 at 4:59 PM, Gabriel Moreira
<ga...@gmail.com> wrote:
> Hi all,
>
> I'm trying to have a bookmarkable page that functions in a way that the
> version param is not printed into the URL.
>
> The code follows like this:
>
> Application () {
> mountPage("/study", Study.class);
> }
>
> Study(PageParameters pp) {
> String id = pp.get("id").toString();
> ... // constructs webpage
> }
>
> The problem is that when I go to:
>
> http://localhost/study?id=A
>
> Wicket rewrites the URL to this form:
>
> http://localhost/study?0&id=A
>
> If I change the id parameter, let's say, to 'id=B', it continues to display
> the 0 version of that page.
> Seems to be the right behaviour if the parameter was the same. Now that it
> has changed its value, shouldn't have Wicket redirected me to the newer
> version automatically, like this?
>
> http://localhost/study?1&id=B
>
> I'm running Wicket 1.5-RC1.
>
> Is there any way to fix this, or surround this problem?
>
> Thank you
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org