You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2013/12/12 17:19:52 UTC

WICKET-4488: URL with a previous page version ignores requested page based on mount path

Hi,

I am using Wicket 1.4.x with HybridUrlCodingStrategy and I have a situation
very similar to one described in WICKET-4488. HybridUrlCodingStrategy does
a check whether existing page has the same mount path but there is no check
if existing page parameters have the same values as in the current request.
WICKET-4488 does not solve this issue.

Here is an example from this issue but a little bit modified - I am using
the same page mount but with different parameter:

I have a 1 mount /page1 with parameter id and the following sequence:
1-With a new session, user visits "/page1/id/555". Displayed URL is
"/page1/id/555?0"
2-Whatever, without expiring session
3-User requests URL "/page1/id/666?0" because it was bookmarked, received
via email, etc.
4-Rendered page is "/page1/id/666?0" which was stored in the page map. But
actual page displayed is with page parameter id=555. So the wrong object is
presented on the screen.

Probably the same issue exists in 1.5.x, 6.x versions.
In 1.4.x to HybridUrlCodingStrategy.decode() I have modified a condition:
  if ((page != null) && page.getClass().equals(pageClassRef.get()))
to:
  if ((page != null) && page.getClass().equals(pageClassRef.get())
          && parametersEqual(page.getPageParameters(), parameters))

where parametersEqual(...) method check two PageParameters equality.

Maybe it should be corrected in newer Wicket versions also?

--
Best regards,
Daniel

Re: WICKET-4488: URL with a previous page version ignores requested page based on mount path

Posted by Martin Grigorov <mg...@apache.org>.
Done.

Martin Grigorov
Wicket Training & Consulting


On Fri, Dec 13, 2013 at 4:53 PM, Daniel Stoch <da...@gmail.com>wrote:

> Ok, I didn't search for this issue in Jira so I didn't know that it already
> exists (maybe it should be linked with WICKET-4488 ;)).
>
> --
> Best regards,
> Daniel
>
>
> On Fri, Dec 13, 2013 at 2:29 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Hi,
> >
> > As you may know Wicket 1.4 is not maintained anymore.
> >
> > For 1.5/6.x/7.x we already have
> > https://issues.apache.org/jira/browse/WICKET-4441
> >
> >
> > On Thu, Dec 12, 2013 at 6:19 PM, Daniel Stoch <daniel.stoch@gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > I am using Wicket 1.4.x with HybridUrlCodingStrategy and I have a
> > situation
> > > very similar to one described in WICKET-4488. HybridUrlCodingStrategy
> > does
> > > a check whether existing page has the same mount path but there is no
> > check
> > > if existing page parameters have the same values as in the current
> > request.
> > > WICKET-4488 does not solve this issue.
> > >
> > > Here is an example from this issue but a little bit modified - I am
> using
> > > the same page mount but with different parameter:
> > >
> > > I have a 1 mount /page1 with parameter id and the following sequence:
> > > 1-With a new session, user visits "/page1/id/555". Displayed URL is
> > > "/page1/id/555?0"
> > > 2-Whatever, without expiring session
> > > 3-User requests URL "/page1/id/666?0" because it was bookmarked,
> received
> > > via email, etc.
> > > 4-Rendered page is "/page1/id/666?0" which was stored in the page map.
> > But
> > > actual page displayed is with page parameter id=555. So the wrong
> object
> > is
> > > presented on the screen.
> > >
> > > Probably the same issue exists in 1.5.x, 6.x versions.
> > > In 1.4.x to HybridUrlCodingStrategy.decode() I have modified a
> condition:
> > >   if ((page != null) && page.getClass().equals(pageClassRef.get()))
> > > to:
> > >   if ((page != null) && page.getClass().equals(pageClassRef.get())
> > >           && parametersEqual(page.getPageParameters(), parameters))
> > >
> > > where parametersEqual(...) method check two PageParameters equality.
> > >
> > > Maybe it should be corrected in newer Wicket versions also?
> > >
> > > --
> > > Best regards,
> > > Daniel
> > >
> >
>

Re: WICKET-4488: URL with a previous page version ignores requested page based on mount path

Posted by Daniel Stoch <da...@gmail.com>.
Ok, I didn't search for this issue in Jira so I didn't know that it already
exists (maybe it should be linked with WICKET-4488 ;)).

--
Best regards,
Daniel


On Fri, Dec 13, 2013 at 2:29 PM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> As you may know Wicket 1.4 is not maintained anymore.
>
> For 1.5/6.x/7.x we already have
> https://issues.apache.org/jira/browse/WICKET-4441
>
>
> On Thu, Dec 12, 2013 at 6:19 PM, Daniel Stoch <daniel.stoch@gmail.com
> >wrote:
>
> > Hi,
> >
> > I am using Wicket 1.4.x with HybridUrlCodingStrategy and I have a
> situation
> > very similar to one described in WICKET-4488. HybridUrlCodingStrategy
> does
> > a check whether existing page has the same mount path but there is no
> check
> > if existing page parameters have the same values as in the current
> request.
> > WICKET-4488 does not solve this issue.
> >
> > Here is an example from this issue but a little bit modified - I am using
> > the same page mount but with different parameter:
> >
> > I have a 1 mount /page1 with parameter id and the following sequence:
> > 1-With a new session, user visits "/page1/id/555". Displayed URL is
> > "/page1/id/555?0"
> > 2-Whatever, without expiring session
> > 3-User requests URL "/page1/id/666?0" because it was bookmarked, received
> > via email, etc.
> > 4-Rendered page is "/page1/id/666?0" which was stored in the page map.
> But
> > actual page displayed is with page parameter id=555. So the wrong object
> is
> > presented on the screen.
> >
> > Probably the same issue exists in 1.5.x, 6.x versions.
> > In 1.4.x to HybridUrlCodingStrategy.decode() I have modified a condition:
> >   if ((page != null) && page.getClass().equals(pageClassRef.get()))
> > to:
> >   if ((page != null) && page.getClass().equals(pageClassRef.get())
> >           && parametersEqual(page.getPageParameters(), parameters))
> >
> > where parametersEqual(...) method check two PageParameters equality.
> >
> > Maybe it should be corrected in newer Wicket versions also?
> >
> > --
> > Best regards,
> > Daniel
> >
>

Re: WICKET-4488: URL with a previous page version ignores requested page based on mount path

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

As you may know Wicket 1.4 is not maintained anymore.

For 1.5/6.x/7.x we already have
https://issues.apache.org/jira/browse/WICKET-4441


On Thu, Dec 12, 2013 at 6:19 PM, Daniel Stoch <da...@gmail.com>wrote:

> Hi,
>
> I am using Wicket 1.4.x with HybridUrlCodingStrategy and I have a situation
> very similar to one described in WICKET-4488. HybridUrlCodingStrategy does
> a check whether existing page has the same mount path but there is no check
> if existing page parameters have the same values as in the current request.
> WICKET-4488 does not solve this issue.
>
> Here is an example from this issue but a little bit modified - I am using
> the same page mount but with different parameter:
>
> I have a 1 mount /page1 with parameter id and the following sequence:
> 1-With a new session, user visits "/page1/id/555". Displayed URL is
> "/page1/id/555?0"
> 2-Whatever, without expiring session
> 3-User requests URL "/page1/id/666?0" because it was bookmarked, received
> via email, etc.
> 4-Rendered page is "/page1/id/666?0" which was stored in the page map. But
> actual page displayed is with page parameter id=555. So the wrong object is
> presented on the screen.
>
> Probably the same issue exists in 1.5.x, 6.x versions.
> In 1.4.x to HybridUrlCodingStrategy.decode() I have modified a condition:
>   if ((page != null) && page.getClass().equals(pageClassRef.get()))
> to:
>   if ((page != null) && page.getClass().equals(pageClassRef.get())
>           && parametersEqual(page.getPageParameters(), parameters))
>
> where parametersEqual(...) method check two PageParameters equality.
>
> Maybe it should be corrected in newer Wicket versions also?
>
> --
> Best regards,
> Daniel
>