You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sam Zilverberg <sa...@gmail.com> on 2012/07/11 21:54:47 UTC

wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Hi,

Sadly I didn't find any similar thread on nabble or stackoverflow...

In wicket 1.4 I had a mount for /devices that lead to a page that shows a
data table with some filtering options.
The page is stateful - mainly because of the filtering options.
when you filter the url changes to /device::bla bla bla:listener:wicket
stuff here...
I do not wish to turn this page to a stateless one.

Changing to wicket 1.5, when a user navigates to /devices it turns it to
/devices?1
and then when he filters it changes to /devices?2.
Then when he goes again to /devices he lands on /devices?3
Every click on the menu item that leads to /devices will increase the page
id...
I have no problem that the page is being constructed everytime.
I'd like the base page (before filtering) to not show the page id, so it
will be /devices always.
After filtering I don't care what the url is...

Is there anyway to achieve this in 1.5?

Re: wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Posted by samzilverberg <sa...@gmail.com>.
Tried the mapper.
It looks like it behaves exactly as overriding isVersioned to return false
at the wanted page...

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-1-4-to-1-5-migration-page-id-in-urls-issue-how-to-remove-for-certain-pages-tp4650445p4650544.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Posted by Thomas Heigl <th...@umschalt.com>.
Hi Sam,

I wrote a custom MountedMapper for the project I'm currently working on.
All it does, is not rendering the page version info for pages. For all
other components it is still turned on. IMHO this mimics the pre-1.5
behavior. We've been using it in production for quite a while now and it
works fine:

public static class NoHybridMountedMapper extends MountedMapper {
> public NoHybridMountedMapper(String mountPath, Class<? extends
> IRequestablePage> pageClass) {
> super(mountPath, pageClass);
> }
> @Override
> protected void encodePageComponentInfo(Url url, PageComponentInfo info) {
> final boolean isComponentListener = info != null &&
> info.getComponentInfo() != null;
> if (isComponentListener) {
> // only encode information about components, not pages
> super.encodePageComponentInfo(url, info);
> }
> }
> }


Hope this helps,

Cheers,

Thomas

On Thu, Jul 12, 2012 at 9:15 AM, Sam Zilverberg <sa...@gmail.com>wrote:

> Thank you very much Jeremy!
> It was a good read through, very informative!
> I already browsed through Ivan's post but deemed it unrelevant to my
> problem on the first read.
> After reading the second post, then reading Ivan's post again, I now
> understand the page versioning system a lot better :)
>
> Sadly though now I'm not sure there is a solution to my problem and that I
> will have to cope with how the versioning/url works now.
> I'm looking for another way to encode the page version, possibly not into
> the url but using cookies/http headers/session/anything.
> I will search nabble/stackoverflow for this.
> If you already have links to posts dealing with this matter feel free to
> post them :)
> I will definitely post any links I find that are useful for anyone who
> encounters this post in the future.
>
>
> On Thu, Jul 12, 2012 at 2:43 AM, Jeremy Thomerson <
> jeremy@wickettraining.com
> > wrote:
>
> > On Wed, Jul 11, 2012 at 6:41 PM, Jeremy Thomerson <
> > jeremy@wickettraining.com
> > > wrote:
> >
> > >
> > > On Wed, Jul 11, 2012 at 2:54 PM, Sam Zilverberg <
> samzilverberg@gmail.com
> > >wrote:
> > >
> > >> I have no problem that the page is being constructed everytime.
> > >>
> > >
> > > Just one note here: the page is not being constructed every time.  Put
> a
> > > breakpoint or System.out.println in your constructor to verify this.
> >  There
> > > was a change in Wicket 1.5 that increases the page ID for each change
> > > rather than having the older ID and version number combination.
> > >
> > > See this post where Igor schooled me in the new stuff :)
> > > http://tinyurl.com/cmfrpj9
> > >
> > > --
> > > Jeremy Thomerson
> > > http://wickettraining.com
> > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > >
> >
> > And see this post for the more direct answer to your original question:
> > http://tinyurl.com/cdl99xy
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>

Re: wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Posted by Sam Zilverberg <sa...@gmail.com>.
Thank you very much Jeremy!
It was a good read through, very informative!
I already browsed through Ivan's post but deemed it unrelevant to my
problem on the first read.
After reading the second post, then reading Ivan's post again, I now
understand the page versioning system a lot better :)

Sadly though now I'm not sure there is a solution to my problem and that I
will have to cope with how the versioning/url works now.
I'm looking for another way to encode the page version, possibly not into
the url but using cookies/http headers/session/anything.
I will search nabble/stackoverflow for this.
If you already have links to posts dealing with this matter feel free to
post them :)
I will definitely post any links I find that are useful for anyone who
encounters this post in the future.


On Thu, Jul 12, 2012 at 2:43 AM, Jeremy Thomerson <jeremy@wickettraining.com
> wrote:

> On Wed, Jul 11, 2012 at 6:41 PM, Jeremy Thomerson <
> jeremy@wickettraining.com
> > wrote:
>
> >
> > On Wed, Jul 11, 2012 at 2:54 PM, Sam Zilverberg <samzilverberg@gmail.com
> >wrote:
> >
> >> I have no problem that the page is being constructed everytime.
> >>
> >
> > Just one note here: the page is not being constructed every time.  Put a
> > breakpoint or System.out.println in your constructor to verify this.
>  There
> > was a change in Wicket 1.5 that increases the page ID for each change
> > rather than having the older ID and version number combination.
> >
> > See this post where Igor schooled me in the new stuff :)
> > http://tinyurl.com/cmfrpj9
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>
> And see this post for the more direct answer to your original question:
> http://tinyurl.com/cdl99xy
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

Re: wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jul 11, 2012 at 6:41 PM, Jeremy Thomerson <jeremy@wickettraining.com
> wrote:

>
> On Wed, Jul 11, 2012 at 2:54 PM, Sam Zilverberg <sa...@gmail.com>wrote:
>
>> I have no problem that the page is being constructed everytime.
>>
>
> Just one note here: the page is not being constructed every time.  Put a
> breakpoint or System.out.println in your constructor to verify this.  There
> was a change in Wicket 1.5 that increases the page ID for each change
> rather than having the older ID and version number combination.
>
> See this post where Igor schooled me in the new stuff :)
> http://tinyurl.com/cmfrpj9
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

And see this post for the more direct answer to your original question:
http://tinyurl.com/cdl99xy

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Re: wicket 1.4 to 1.5 migration - page id in urls issue - how to remove for certain pages

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jul 11, 2012 at 2:54 PM, Sam Zilverberg <sa...@gmail.com>wrote:

> I have no problem that the page is being constructed everytime.
>

Just one note here: the page is not being constructed every time.  Put a
breakpoint or System.out.println in your constructor to verify this.  There
was a change in Wicket 1.5 that increases the page ID for each change
rather than having the older ID and version number combination.

See this post where Igor schooled me in the new stuff :)
http://tinyurl.com/cmfrpj9

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*