You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by uud ashr <uu...@gmail.com> on 2009/07/29 11:08:08 UTC

Fancy URL

Hi all,

Need help here.
What is the best way or how can I mount this kind of URL?
*http://localhost/app/blog/myblog* -> it go to Blog.class
*http://localhost/app/blog/myblog/201* -> go to BlogDetails.class which open
blog entry with ID 201
*http://localhost/app/blog/myblog/category* -> go to BlogCategory.class
which shows list of categories for myblob
*http://localhost/app/blog/myblog/category/22*2 -> go to
BlogCategoryDetails.class whicho shows details of category with ID 222

Regards,
uudashr

Re: Fancy URL

Posted by uud ashr <uu...@gmail.com>.
Okay thx, I'll read it

On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
wicket.programmer@gmail.com> wrote:

>
> take a look at HybridUrlCodingStrategy
> --
> View this message in context:
> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
> Sent from the Wicket - User 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: Fancy URL

Posted by Martijn Dashorst <ma...@gmail.com>.
Don't use setResponsePage in the constructor. There have been enough
reports of failures reported to this list.

Martijn

On Wed, Aug 5, 2009 at 12:53 PM, uud ashr<uu...@gmail.com> wrote:
> Works,
> Thx Igor.
> I try to use setResponsePage to BlogDetails on the constructor of the Blog
> page and it works too.
>
> So any recommendation picking between *setResponsePage* and throw *
> RestartResponseException*?
>
> Regards,
> uudashr
>
> On Wed, Aug 5, 2009 at 11:21 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> in that cause either use restartresponseexception(page) to route the
>> request from one page to another, or use the same page and use panels
>> as content.
>>
>> -igor
>>
>> On Tue, Aug 4, 2009 at 9:18 PM, uud ashr<uu...@gmail.com> wrote:
>> > Sorry I forgot,
>> > *myblog* can be changes, because there would be a lot of blog there
>> > (eg: *myblog,
>> > yourblog, testblog*), the we can get the value from the database.
>> >
>> > i use */blog* mount path and get the parameter next to it, */blog/myblog*
>> it
>> > means shows blog page for *"myblog"*, */blog/yourblog* shows blog page
>> for *
>> > "yourblog"* simply by query from database "select * from blogentry where
>> > blogname = 'yourblog' "
>> >
>> > So thats why the only path to mount is *"/blog"*
>> >
>> > Any idea?
>> >
>> > On Wed, Aug 5, 2009 at 10:29 AM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> have you even tried mounting a page onto "/blog/myblog" and another
>> >> onto "/blog/myblog/category"? because that will do what you want.
>> >>
>> >> -igor
>> >>
>> >> On Tue, Aug 4, 2009 at 8:21 PM, uud ashr<uu...@gmail.com> wrote:
>> >> > Hi Igor,
>> >> > Thx for replying. I know (or maybe I'm wrong), but I want same
>> mountPath
>> >> for
>> >> > a different class based on it's parameter. I see several things like
>> this
>> >> on
>> >> > ruby, I can do this too on Grails, I wonder how to do this on Wicket.
>> >> >
>> >> > *http://localhost/app/blog/myblog* -> it go to Blog.class
>> >> > *http://localhost/app/blog/myblog/201* -> go to BlogDetails.class
>> which
>> >> open
>> >> > blog entry with ID 201
>> >> > *http://localhost/app/blog/myblog/category* -> go to
>> BlogCategory.class
>> >> > which shows list of categories for myblob
>> >> > *http://localhost/app/blog/myblog/category/22*2 -> go to
>> >> > BlogCategoryDetails.class which shows details of category with ID 222
>> or
>> >> > view all blog entry based on category 222
>> >> >
>> >> > all the url using "blog" mountPath, but it use different class to
>> process
>> >> >
>> >> > On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <
>> igor.vaynberg@gmail.com
>> >> >wrote:
>> >> >
>> >> >> simply mounted a page onto "/blog" and giving it a constructor that
>> >> >> takes pageparameters will let you handle
>> >> >> /blog/param1/value1/param2/value2 urls.
>> >> >>
>> >> >> if you want to handle /blog/value1/value2/value3/value4 urls you can
>> >> >> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
>> >> >> explain how to access those values.
>> >> >>
>> >> >> -igor
>> >> >>
>> >> >>
>> >> >> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
>> >> >> > I've looked to HybridUrlCodingStrategy this is not what I expected.
>> >> >> > Using HybridUrlCodingStrategy I can do
>> >> /blog/param1/value1/param2/value2
>> >> >> > which is:
>> >> >> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
>> >> >> >  Blog.class)) and call url /blog and without no parameter defined,
>> >> that
>> >> >> is
>> >> >> > OK
>> >> >> > 2. How can we address another "blog" for BlogDetails.class,
>> >> >> > BlogCategory.class, BlogCategoryDetails.class ?
>> >> >> >
>> >> >> > Anyone can help me?
>> >> >> >
>> >> >> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
>> >> >> > wicket.programmer@gmail.com> wrote:
>> >> >> >
>> >> >> >>
>> >> >> >> take a look at HybridUrlCodingStrategy
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
>> >> >> >> Sent from the Wicket - User 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
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> 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
>>
>>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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


Re: Fancy URL

Posted by uud ashr <uu...@gmail.com>.
Works,
Thx Igor.
I try to use setResponsePage to BlogDetails on the constructor of the Blog
page and it works too.

So any recommendation picking between *setResponsePage* and throw *
RestartResponseException*?

Regards,
uudashr

On Wed, Aug 5, 2009 at 11:21 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> in that cause either use restartresponseexception(page) to route the
> request from one page to another, or use the same page and use panels
> as content.
>
> -igor
>
> On Tue, Aug 4, 2009 at 9:18 PM, uud ashr<uu...@gmail.com> wrote:
> > Sorry I forgot,
> > *myblog* can be changes, because there would be a lot of blog there
> > (eg: *myblog,
> > yourblog, testblog*), the we can get the value from the database.
> >
> > i use */blog* mount path and get the parameter next to it, */blog/myblog*
> it
> > means shows blog page for *"myblog"*, */blog/yourblog* shows blog page
> for *
> > "yourblog"* simply by query from database "select * from blogentry where
> > blogname = 'yourblog' "
> >
> > So thats why the only path to mount is *"/blog"*
> >
> > Any idea?
> >
> > On Wed, Aug 5, 2009 at 10:29 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> have you even tried mounting a page onto "/blog/myblog" and another
> >> onto "/blog/myblog/category"? because that will do what you want.
> >>
> >> -igor
> >>
> >> On Tue, Aug 4, 2009 at 8:21 PM, uud ashr<uu...@gmail.com> wrote:
> >> > Hi Igor,
> >> > Thx for replying. I know (or maybe I'm wrong), but I want same
> mountPath
> >> for
> >> > a different class based on it's parameter. I see several things like
> this
> >> on
> >> > ruby, I can do this too on Grails, I wonder how to do this on Wicket.
> >> >
> >> > *http://localhost/app/blog/myblog* -> it go to Blog.class
> >> > *http://localhost/app/blog/myblog/201* -> go to BlogDetails.class
> which
> >> open
> >> > blog entry with ID 201
> >> > *http://localhost/app/blog/myblog/category* -> go to
> BlogCategory.class
> >> > which shows list of categories for myblob
> >> > *http://localhost/app/blog/myblog/category/22*2 -> go to
> >> > BlogCategoryDetails.class which shows details of category with ID 222
> or
> >> > view all blog entry based on category 222
> >> >
> >> > all the url using "blog" mountPath, but it use different class to
> process
> >> >
> >> > On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> simply mounted a page onto "/blog" and giving it a constructor that
> >> >> takes pageparameters will let you handle
> >> >> /blog/param1/value1/param2/value2 urls.
> >> >>
> >> >> if you want to handle /blog/value1/value2/value3/value4 urls you can
> >> >> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
> >> >> explain how to access those values.
> >> >>
> >> >> -igor
> >> >>
> >> >>
> >> >> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
> >> >> > I've looked to HybridUrlCodingStrategy this is not what I expected.
> >> >> > Using HybridUrlCodingStrategy I can do
> >> /blog/param1/value1/param2/value2
> >> >> > which is:
> >> >> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
> >> >> >  Blog.class)) and call url /blog and without no parameter defined,
> >> that
> >> >> is
> >> >> > OK
> >> >> > 2. How can we address another "blog" for BlogDetails.class,
> >> >> > BlogCategory.class, BlogCategoryDetails.class ?
> >> >> >
> >> >> > Anyone can help me?
> >> >> >
> >> >> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
> >> >> > wicket.programmer@gmail.com> wrote:
> >> >> >
> >> >> >>
> >> >> >> take a look at HybridUrlCodingStrategy
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
> >> >> >> Sent from the Wicket - User 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
> >> >> >>
> >> >> >>
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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: Fancy URL

Posted by Igor Vaynberg <ig...@gmail.com>.
in that cause either use restartresponseexception(page) to route the
request from one page to another, or use the same page and use panels
as content.

-igor

On Tue, Aug 4, 2009 at 9:18 PM, uud ashr<uu...@gmail.com> wrote:
> Sorry I forgot,
> *myblog* can be changes, because there would be a lot of blog there
> (eg: *myblog,
> yourblog, testblog*), the we can get the value from the database.
>
> i use */blog* mount path and get the parameter next to it, */blog/myblog* it
> means shows blog page for *"myblog"*, */blog/yourblog* shows blog page for *
> "yourblog"* simply by query from database "select * from blogentry where
> blogname = 'yourblog' "
>
> So thats why the only path to mount is *"/blog"*
>
> Any idea?
>
> On Wed, Aug 5, 2009 at 10:29 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> have you even tried mounting a page onto "/blog/myblog" and another
>> onto "/blog/myblog/category"? because that will do what you want.
>>
>> -igor
>>
>> On Tue, Aug 4, 2009 at 8:21 PM, uud ashr<uu...@gmail.com> wrote:
>> > Hi Igor,
>> > Thx for replying. I know (or maybe I'm wrong), but I want same mountPath
>> for
>> > a different class based on it's parameter. I see several things like this
>> on
>> > ruby, I can do this too on Grails, I wonder how to do this on Wicket.
>> >
>> > *http://localhost/app/blog/myblog* -> it go to Blog.class
>> > *http://localhost/app/blog/myblog/201* -> go to BlogDetails.class which
>> open
>> > blog entry with ID 201
>> > *http://localhost/app/blog/myblog/category* -> go to BlogCategory.class
>> > which shows list of categories for myblob
>> > *http://localhost/app/blog/myblog/category/22*2 -> go to
>> > BlogCategoryDetails.class which shows details of category with ID 222 or
>> > view all blog entry based on category 222
>> >
>> > all the url using "blog" mountPath, but it use different class to process
>> >
>> > On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> simply mounted a page onto "/blog" and giving it a constructor that
>> >> takes pageparameters will let you handle
>> >> /blog/param1/value1/param2/value2 urls.
>> >>
>> >> if you want to handle /blog/value1/value2/value3/value4 urls you can
>> >> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
>> >> explain how to access those values.
>> >>
>> >> -igor
>> >>
>> >>
>> >> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
>> >> > I've looked to HybridUrlCodingStrategy this is not what I expected.
>> >> > Using HybridUrlCodingStrategy I can do
>> /blog/param1/value1/param2/value2
>> >> > which is:
>> >> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
>> >> >  Blog.class)) and call url /blog and without no parameter defined,
>> that
>> >> is
>> >> > OK
>> >> > 2. How can we address another "blog" for BlogDetails.class,
>> >> > BlogCategory.class, BlogCategoryDetails.class ?
>> >> >
>> >> > Anyone can help me?
>> >> >
>> >> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
>> >> > wicket.programmer@gmail.com> wrote:
>> >> >
>> >> >>
>> >> >> take a look at HybridUrlCodingStrategy
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
>> >> >> Sent from the Wicket - User 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
>> >> >>
>> >> >>
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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: Fancy URL

Posted by uud ashr <uu...@gmail.com>.
Sorry I forgot,
*myblog* can be changes, because there would be a lot of blog there
(eg: *myblog,
yourblog, testblog*), the we can get the value from the database.

i use */blog* mount path and get the parameter next to it, */blog/myblog* it
means shows blog page for *"myblog"*, */blog/yourblog* shows blog page for *
"yourblog"* simply by query from database "select * from blogentry where
blogname = 'yourblog' "

So thats why the only path to mount is *"/blog"*

Any idea?

On Wed, Aug 5, 2009 at 10:29 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> have you even tried mounting a page onto "/blog/myblog" and another
> onto "/blog/myblog/category"? because that will do what you want.
>
> -igor
>
> On Tue, Aug 4, 2009 at 8:21 PM, uud ashr<uu...@gmail.com> wrote:
> > Hi Igor,
> > Thx for replying. I know (or maybe I'm wrong), but I want same mountPath
> for
> > a different class based on it's parameter. I see several things like this
> on
> > ruby, I can do this too on Grails, I wonder how to do this on Wicket.
> >
> > *http://localhost/app/blog/myblog* -> it go to Blog.class
> > *http://localhost/app/blog/myblog/201* -> go to BlogDetails.class which
> open
> > blog entry with ID 201
> > *http://localhost/app/blog/myblog/category* -> go to BlogCategory.class
> > which shows list of categories for myblob
> > *http://localhost/app/blog/myblog/category/22*2 -> go to
> > BlogCategoryDetails.class which shows details of category with ID 222 or
> > view all blog entry based on category 222
> >
> > all the url using "blog" mountPath, but it use different class to process
> >
> > On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> simply mounted a page onto "/blog" and giving it a constructor that
> >> takes pageparameters will let you handle
> >> /blog/param1/value1/param2/value2 urls.
> >>
> >> if you want to handle /blog/value1/value2/value3/value4 urls you can
> >> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
> >> explain how to access those values.
> >>
> >> -igor
> >>
> >>
> >> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
> >> > I've looked to HybridUrlCodingStrategy this is not what I expected.
> >> > Using HybridUrlCodingStrategy I can do
> /blog/param1/value1/param2/value2
> >> > which is:
> >> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
> >> >  Blog.class)) and call url /blog and without no parameter defined,
> that
> >> is
> >> > OK
> >> > 2. How can we address another "blog" for BlogDetails.class,
> >> > BlogCategory.class, BlogCategoryDetails.class ?
> >> >
> >> > Anyone can help me?
> >> >
> >> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
> >> > wicket.programmer@gmail.com> wrote:
> >> >
> >> >>
> >> >> take a look at HybridUrlCodingStrategy
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
> >> >> Sent from the Wicket - User 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
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: Fancy URL

Posted by Igor Vaynberg <ig...@gmail.com>.
have you even tried mounting a page onto "/blog/myblog" and another
onto "/blog/myblog/category"? because that will do what you want.

-igor

On Tue, Aug 4, 2009 at 8:21 PM, uud ashr<uu...@gmail.com> wrote:
> Hi Igor,
> Thx for replying. I know (or maybe I'm wrong), but I want same mountPath for
> a different class based on it's parameter. I see several things like this on
> ruby, I can do this too on Grails, I wonder how to do this on Wicket.
>
> *http://localhost/app/blog/myblog* -> it go to Blog.class
> *http://localhost/app/blog/myblog/201* -> go to BlogDetails.class which open
> blog entry with ID 201
> *http://localhost/app/blog/myblog/category* -> go to BlogCategory.class
> which shows list of categories for myblob
> *http://localhost/app/blog/myblog/category/22*2 -> go to
> BlogCategoryDetails.class which shows details of category with ID 222 or
> view all blog entry based on category 222
>
> all the url using "blog" mountPath, but it use different class to process
>
> On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> simply mounted a page onto "/blog" and giving it a constructor that
>> takes pageparameters will let you handle
>> /blog/param1/value1/param2/value2 urls.
>>
>> if you want to handle /blog/value1/value2/value3/value4 urls you can
>> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
>> explain how to access those values.
>>
>> -igor
>>
>>
>> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
>> > I've looked to HybridUrlCodingStrategy this is not what I expected.
>> > Using HybridUrlCodingStrategy I can do /blog/param1/value1/param2/value2
>> > which is:
>> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
>> >  Blog.class)) and call url /blog and without no parameter defined, that
>> is
>> > OK
>> > 2. How can we address another "blog" for BlogDetails.class,
>> > BlogCategory.class, BlogCategoryDetails.class ?
>> >
>> > Anyone can help me?
>> >
>> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
>> > wicket.programmer@gmail.com> wrote:
>> >
>> >>
>> >> take a look at HybridUrlCodingStrategy
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
>> >> Sent from the Wicket - User 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
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> 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: Fancy URL

Posted by uud ashr <uu...@gmail.com>.
Hi Igor,
Thx for replying. I know (or maybe I'm wrong), but I want same mountPath for
a different class based on it's parameter. I see several things like this on
ruby, I can do this too on Grails, I wonder how to do this on Wicket.

*http://localhost/app/blog/myblog* -> it go to Blog.class
*http://localhost/app/blog/myblog/201* -> go to BlogDetails.class which open
blog entry with ID 201
*http://localhost/app/blog/myblog/category* -> go to BlogCategory.class
which shows list of categories for myblob
*http://localhost/app/blog/myblog/category/22*2 -> go to
BlogCategoryDetails.class which shows details of category with ID 222 or
view all blog entry based on category 222

all the url using "blog" mountPath, but it use different class to process

On Wed, Aug 5, 2009 at 9:39 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> simply mounted a page onto "/blog" and giving it a constructor that
> takes pageparameters will let you handle
> /blog/param1/value1/param2/value2 urls.
>
> if you want to handle /blog/value1/value2/value3/value4 urls you can
> mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
> explain how to access those values.
>
> -igor
>
>
> On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
> > I've looked to HybridUrlCodingStrategy this is not what I expected.
> > Using HybridUrlCodingStrategy I can do /blog/param1/value1/param2/value2
> > which is:
> > 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
> >  Blog.class)) and call url /blog and without no parameter defined, that
> is
> > OK
> > 2. How can we address another "blog" for BlogDetails.class,
> > BlogCategory.class, BlogCategoryDetails.class ?
> >
> > Anyone can help me?
> >
> > On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
> > wicket.programmer@gmail.com> wrote:
> >
> >>
> >> take a look at HybridUrlCodingStrategy
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
> >> Sent from the Wicket - User 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Fancy URL

Posted by Igor Vaynberg <ig...@gmail.com>.
simply mounted a page onto "/blog" and giving it a constructor that
takes pageparameters will let you handle
/blog/param1/value1/param2/value2 urls.

if you want to handle /blog/value1/value2/value3/value4 urls you can
mount the page with IndexedParamUrlCodingStrategy. Its javadoc will
explain how to access those values.

-igor


On Tue, Aug 4, 2009 at 7:35 PM, uud ashr<uu...@gmail.com> wrote:
> I've looked to HybridUrlCodingStrategy this is not what I expected.
> Using HybridUrlCodingStrategy I can do /blog/param1/value1/param2/value2
> which is:
> 1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
>  Blog.class)) and call url /blog and without no parameter defined, that is
> OK
> 2. How can we address another "blog" for BlogDetails.class,
> BlogCategory.class, BlogCategoryDetails.class ?
>
> Anyone can help me?
>
> On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
> wicket.programmer@gmail.com> wrote:
>
>>
>> take a look at HybridUrlCodingStrategy
>> --
>> View this message in context:
>> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
>> Sent from the Wicket - User 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
>>
>>
>

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


Re: Fancy URL

Posted by uud ashr <uu...@gmail.com>.
I've looked to HybridUrlCodingStrategy this is not what I expected.
Using HybridUrlCodingStrategy I can do /blog/param1/value1/param2/value2
which is:
1. I can use it to bind mount(new HybridUrlCodingStrategy("blog",
 Blog.class)) and call url /blog and without no parameter defined, that is
OK
2. How can we address another "blog" for BlogDetails.class,
BlogCategory.class, BlogCategoryDetails.class ?

Anyone can help me?

On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
wicket.programmer@gmail.com> wrote:

>
> take a look at HybridUrlCodingStrategy
> --
> View this message in context:
> http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
> Sent from the Wicket - User 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: Fancy URL

Posted by Mathias Nilsson <wi...@gmail.com>.
take a look at HybridUrlCodingStrategy
-- 
View this message in context: http://www.nabble.com/Fancy-URL-tp24715302p24720044.html
Sent from the Wicket - User 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