You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by S D <su...@yahoo.com> on 2008/10/29 00:03:01 UTC

Wicket and URLs

Hi,

I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL:

http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage

The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage     
destroy that impression completely.

I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible.

Thanks




      


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


Re: Wicket and URLs

Posted by Jeremy Thomerson <je...@wickettraining.com>.
You can also mount all pages in a package with one single call.   You will
find this in old emails on the list, blogs, etc..

Google search for "wicket mount package":
http://www.google.com/search?hl=en&rls=com.microsoft%3A*&q=wicket+bookmarkable+urls

The third result:
http://www.javalobby.org/java/forums/t68753.html

And in that page:
mount("/main", PackageName.forClass(AlohaPage.class));

Hope this helps!

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


On Tue, Oct 28, 2008 at 7:43 PM, S D <su...@yahoo.com> wrote:

> --- On Wed, 10/29/08, Scott Swank <sc...@gmail.com> wrote:
>
> > Those will be available to you in the
> > YourPage(PageParameters
> > parameters) constructor.
> >
>
> So, if I understand you correctly, I'd have to call mountBookmarkablePage()
> for all wicket URLs used in the application. Sounds somewhat tedious but
> should be doable.
>
> No simpler way to achieve this?
>
> Thanks
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket and URLs

Posted by Igor Vaynberg <ig...@gmail.com>.
you would map one page to handle this with IndexedUrlCodingStrategy on
www.oursite.tld/products/

this page will have a constructor that takes a PageParameters object.

from there you can do

string cat=parameters.get("0");
string id=parameters.get("1");
string desc=paramters.get("2");

on the other hand it is interesting how amazon doesnt think that short
and concise urls affect their seo with urls like:

http://www.amazon.com/Transcend-TS8GJFV10-JetFlash-Flash-Drive/dp/B000M4XMGI/ref=xs_gb_bd_AsdvP7FAall-?%255Fencoding=UTF8&pf_rd_p=441937801&pf_rd_s=center-2&pf_rd_t=701&pf_rd_i=20&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0JKDZNDV01P8F1Q5H366


-igor



On Tue, Oct 28, 2008 at 8:46 PM, S D <su...@yahoo.com> wrote:
> --- On Wed, 10/29/08, Jeremy Thomerson <je...@wickettraining.com> wrote:
>
>> You have not given us one example of something that you need
>> to do that
>> cannot have nice URLs with Wicket.  You can mount an entire
>> package of
>> classes to a single path and they will all have nice
>> bookmarkable URLs.
>
> Here's an example I have in mind. Say, we have thousands of products stored in db. I'd like our URLs referring to those products to look something like this:
>
> www.oursite.tld/products/some-category/product-id-here/description-of-the product/
>
> For example, www.oursite.tld/products/books/1234/Learn-Wicket-Now/
>
> There may be thousands of books and each book will have a distinct URL. Should thousands of those URLs be mapped?
>
> Thanks
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by S D <su...@yahoo.com>.
--- On Wed, 10/29/08, Jeremy Thomerson <je...@wickettraining.com> wrote:

> You have not given us one example of something that you need
> to do that
> cannot have nice URLs with Wicket.  You can mount an entire
> package of
> classes to a single path and they will all have nice
> bookmarkable URLs.

Here's an example I have in mind. Say, we have thousands of products stored in db. I'd like our URLs referring to those products to look something like this:

www.oursite.tld/products/some-category/product-id-here/description-of-the product/

For example, www.oursite.tld/products/books/1234/Learn-Wicket-Now/

There may be thousands of books and each book will have a distinct URL. Should thousands of those URLs be mapped?

Thanks



      


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


Re: Wicket and URLs

Posted by Jeremy Thomerson <je...@wickettraining.com>.
You have not given us one example of something that you need to do that
cannot have nice URLs with Wicket.  You can mount an entire package of
classes to a single path and they will all have nice bookmarkable URLs.
There are a variety of different coding strategies that will give you URLs
that look like (take your pick):

http://www.yourapp.com/pages/SomePage/param1-name/param1-value/param2-name/param2-value
http://www.yourapp.com/pages/SomePage?param1-name=param1-value&param2-name=param2-value(standard,
you could say)
http://www.yourapp.com/pages/SomePage/param1-value/param2-value
http://www.yourapp.com/somepage/param1-value/param2-value
Now - that being said - there are certain components that will generate
wicket-specific URLs:
- a normal Link (not a BookmarkablePageLink) for performing some action
other than redirecting to a page
- a form's action URL
- sorting data tables (by default - even this can be overridden for
bookmarkable URLs - but it's a little more work)
- etc....

But, for your standard bookmarkable page use cases, it's fairly easy.


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


On Tue, Oct 28, 2008 at 10:09 PM, S D <su...@yahoo.com> wrote:

> --- On Wed, 10/29/08, Igor Vaynberg <ig...@gmail.com> wrote:
>
> > all of these are for entry urls. urls that link to page
> > instances or after a form submit will still be
> > ?wicket:interface=:4:foo.bar:ILinkListener
> >
> > if you are that concerned with urls wicket might not be for
> > you. you give up control over urls for the
> > convinience of not having to deal
> > with them.
>
> That surely would be a pity, for Wicket looks really nice. The problem on
> our part is that we need our urls to be as short and readable as possible,
> for many reasons (SEO, indexing, etc). It's truly is an important matter.
>
> No way to fix this? Thanks
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket and URLs

Posted by S D <su...@yahoo.com>.
--- On Wed, 10/29/08, Igor Vaynberg <ig...@gmail.com> wrote:

> all of these are for entry urls. urls that link to page
> instances or after a form submit will still be
> ?wicket:interface=:4:foo.bar:ILinkListener
> 
> if you are that concerned with urls wicket might not be for
> you. you give up control over urls for the 
> convinience of not having to deal
> with them.

That surely would be a pity, for Wicket looks really nice. The problem on our part is that we need our urls to be as short and readable as possible, for many reasons (SEO, indexing, etc). It's truly is an important matter.

No way to fix this? Thanks



      


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


Re: Wicket and URLs

Posted by Igor Vaynberg <ig...@gmail.com>.
all of these are for entry urls. urls that link to page instances or
after a form submit will still be
?wicket:interface=:4:foo.bar:ILinkListener

if you are that concerned with urls wicket might not be for you. you
give up control over urls for the convinience of not having to deal
with them.

-igor

On Tue, Oct 28, 2008 at 5:43 PM, S D <su...@yahoo.com> wrote:
> --- On Wed, 10/29/08, Scott Swank <sc...@gmail.com> wrote:
>
>> Those will be available to you in the
>> YourPage(PageParameters
>> parameters) constructor.
>>
>
> So, if I understand you correctly, I'd have to call mountBookmarkablePage() for all wicket URLs used in the application. Sounds somewhat tedious but should be doable.
>
> No simpler way to achieve this?
>
> Thanks
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by S D <su...@yahoo.com>.
--- On Wed, 10/29/08, Scott Swank <sc...@gmail.com> wrote:

> Those will be available to you in the
> YourPage(PageParameters
> parameters) constructor.
> 

So, if I understand you correctly, I'd have to call mountBookmarkablePage() for all wicket URLs used in the application. Sounds somewhat tedious but should be doable.

No simpler way to achieve this?

Thanks





      


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


Re: Wicket and URLs

Posted by Scott Swank <sc...@gmail.com>.
Those will be available to you in the YourPage(PageParameters
parameters) constructor.

On Tue, Oct 28, 2008 at 5:08 PM, S D <su...@yahoo.com> wrote:
>
> But what if the URL is "dynamic" like, for example, is this google URL that points to the second page of results:
>
> http://www.google.com/search?hl=en&q=wicket&start=10&sa=N
>
> Thanks
>
> --- On Tue, 10/28/08, Scott Swank <sc...@gmail.com> wrote:
>
>> One option is to define urls in your application:
>>
>>    mountBookmarkablePage("/Tour",
>> TourBrowsePage.class);
>>
>>
>> On Tue, Oct 28, 2008 at 4:03 PM, S D
>> <su...@yahoo.com> wrote:
>> >
>> > Hi,
>> >
>> > I was browsing through examples, it looks very
>> impressive but there's a thing that bothers me somewhat.
>> The Basic Label example uses the following URL:
>> >
>> >
>> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> >
>> > The problem with that is that we'd like to have an
>> appearance of a technology neutral site (or at least not to
>> be blatant about it) but Jsessionid and especially
>> wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> > destroy that impression completely.
>> >
>> > I understand it's possible to remove Jsessionid
>> from URL but what about Wicket's contribution to the
>> URL? We'd like to keep our URLs as clean and readable as
>> possible.
>> >
>> > Thanks
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by Pablo Abad <pa...@itba.edu.ar>.
Yet another option is to alter the way the URL is coded, though an
IRequestCodingStrategy implementation.
Here are some real examples of how coded urls look:
http://localhost:8080/sga/app/?x=KSuTW5bYBW8iAGSiUeZAF1yzeKycRi5Ob74j2paSOEq3wdTRhBvya*bkbZWOzsXCnbeqR9KlO5rbiYq3d1qPOhlyjMglN8f089MFpg**7hMqGJzL6-GRXQ
http://localhost:8080/sga/app/?x=xwW6dJ7ZC-ZriWTqNWvu**XkWA4ZrVPgSP0joZB5Y8FHRPPfAB*liaDzGAJSEBpw1UX2TC68melk4n8Mzrb*5w



Scott Swank wrote:
> One option is to define urls in your application:
>
>    mountBookmarkablePage("/Tour", TourBrowsePage.class);
>
> On Tue, Oct 28, 2008 at 4:03 PM, S D <su...@yahoo.com> wrote:
>   
>> Hi,
>>
>> I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL:
>>
>> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>>
>> The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> destroy that impression completely.
>>
>> I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible.
>>
>> Thanks
>>
>>     


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


Re: Wicket and URLs

Posted by S D <su...@yahoo.com>.
But what if the URL is "dynamic" like, for example, is this google URL that points to the second page of results:

http://www.google.com/search?hl=en&q=wicket&start=10&sa=N

Thanks

--- On Tue, 10/28/08, Scott Swank <sc...@gmail.com> wrote:

> One option is to define urls in your application:
> 
>    mountBookmarkablePage("/Tour",
> TourBrowsePage.class);
>
>
> On Tue, Oct 28, 2008 at 4:03 PM, S D
> <su...@yahoo.com> wrote:
> >
> > Hi,
> >
> > I was browsing through examples, it looks very
> impressive but there's a thing that bothers me somewhat.
> The Basic Label example uses the following URL:
> >
> >
> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
> >
> > The problem with that is that we'd like to have an
> appearance of a technology neutral site (or at least not to
> be blatant about it) but Jsessionid and especially
> wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
> > destroy that impression completely.
> >
> > I understand it's possible to remove Jsessionid
> from URL but what about Wicket's contribution to the
> URL? We'd like to keep our URLs as clean and readable as
> possible.
> >
> > Thanks



      


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


Re: Wicket and URLs

Posted by Scott Swank <sc...@gmail.com>.
One option is to define urls in your application:

   mountBookmarkablePage("/Tour", TourBrowsePage.class);

On Tue, Oct 28, 2008 at 4:03 PM, S D <su...@yahoo.com> wrote:
>
> Hi,
>
> I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL:
>
> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>
> The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
> destroy that impression completely.
>
> I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible.
>
> Thanks
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by Igor Vaynberg <ig...@gmail.com>.
of course i dont mind.

-igor

On Wed, Oct 29, 2008 at 12:39 AM, Erik van Oosten <e....@grons.nl> wrote:
> Thanks for clarifying limitation no 2, I had not though of this. Indeed in
> my usecase this is not a problem.
> 'Limitation' no 1 is quite intentional.
>
> If you don't mind, I've also added this comment to the article.
>
> Regards,
>   Erik.
>
>
> Igor Vaynberg wrote:
>>
>> while this might work for your usecase this will pretty much break
>> things. the version number is in the url for a reason.
>>
>> 1) it completely kills the backbutton for that page. since the url
>> remains the same the browser wont record your actions in the history.
>> based on what you are trying to do this may or may not be a bad thing.
>>
>> 2) even if you manage to get the back button working this will
>> completely kill applications that use any kind of panel replacement
>> because you no longer have the version information in the url. you
>> have a page with panel A, you click a link and it is swapped with
>> panel B. go back, click a link on A and you are hosed because wicket
>> will look for the component you clicked on panel B instead of A.
>>
>> in all the applications ive written there was at least a moderate
>> amount of panel replacement going on. one of the applications i worked
>> on had the majority of its navigation consist of panel replacement. so
>> i dont think this is a good idea.
>>
>> -igor
>>
>>
>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by Erik van Oosten <e....@grons.nl>.
Thanks for clarifying limitation no 2, I had not though of this. Indeed 
in my usecase this is not a problem.
'Limitation' no 1 is quite intentional.

If you don't mind, I've also added this comment to the article.

Regards,
    Erik.


Igor Vaynberg wrote:
> while this might work for your usecase this will pretty much break
> things. the version number is in the url for a reason.
>
> 1) it completely kills the backbutton for that page. since the url
> remains the same the browser wont record your actions in the history.
> based on what you are trying to do this may or may not be a bad thing.
>
> 2) even if you manage to get the back button working this will
> completely kill applications that use any kind of panel replacement
> because you no longer have the version information in the url. you
> have a page with panel A, you click a link and it is swapped with
> panel B. go back, click a link on A and you are hosed because wicket
> will look for the component you clicked on panel B instead of A.
>
> in all the applications ive written there was at least a moderate
> amount of panel replacement going on. one of the applications i worked
> on had the majority of its navigation consist of panel replacement. so
> i dont think this is a good idea.
>
> -igor
>
>   


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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


Re: Wicket and URLs

Posted by Igor Vaynberg <ig...@gmail.com>.
while this might work for your usecase this will pretty much break
things. the version number is in the url for a reason.

1) it completely kills the backbutton for that page. since the url
remains the same the browser wont record your actions in the history.
based on what you are trying to do this may or may not be a bad thing.

2) even if you manage to get the back button working this will
completely kill applications that use any kind of panel replacement
because you no longer have the version information in the url. you
have a page with panel A, you click a link and it is swapped with
panel B. go back, click a link on A and you are hosed because wicket
will look for the component you clicked on panel B instead of A.

in all the applications ive written there was at least a moderate
amount of panel replacement going on. one of the applications i worked
on had the majority of its navigation consist of panel replacement. so
i dont think this is a good idea.

-igor

On Tue, Oct 28, 2008 at 11:42 PM, Erik van Oosten <e....@grons.nl> wrote:
> Hello S D,
>
> This might interest you:
> http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html
>
> Note there are still some limitations. Your milage may vary.
>
> Regards,
>   Erik.
>
> S D wrote:
>>
>> Hi,
>>
>> I was browsing through examples, it looks very impressive but there's a
>> thing that bothers me somewhat. The Basic Label example uses the following
>> URL:
>>
>>
>> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>>
>> The problem with that is that we'd like to have an appearance of a
>> technology neutral site (or at least not to be blatant about it) but
>> Jsessionid and especially
>> wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> destroy that impression completely.
>>
>> I understand it's possible to remove Jsessionid from URL but what about
>> Wicket's contribution to the URL? We'd like to keep our URLs as clean and
>> readable as possible.
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket and URLs

Posted by Erik van Oosten <e....@grons.nl>.
Hello S D,

This might interest you:
http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html

Note there are still some limitations. Your milage may vary.

Regards,
    Erik.

S D wrote:
> Hi,
>
> I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL:
>
> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>
> The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage     
> destroy that impression completely.
>
> I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible.
>
> Thanks
>
>
>
>
>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

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