You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by DV <hu...@yahoo.com> on 2009/04/10 17:11:24 UTC

URL rewriting

We are evaluating wicket to rewrite our consumer UI.

There is one requirement in which I would like to get advice on.

We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of "/company/**-details.html".

We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found.

e.g /company/ABC-details.html, /company/TOTO-details.html etc

Can this be done in wicket?

Any advice or hints would be appreciated!

Dinp


      

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


Re: URL rewriting

Posted by Janos Cserep <cs...@metaprime.hu>.
You have to mount your page via MixedParamUrlCodingStrategy:

mount(new MixedParamUrlCodingStrategy("/company", CompanyPage.class, new
String[] {"companyName"});

and in CompanyPage(PageParameters parameters) constructor do something like
this:

String nameInUrl = parameters.getString();
String company = nameInUrl.substring(0, ...);


On Fri, Apr 10, 2009 at 5:11 PM, DV <hu...@yahoo.com> wrote:

>
> We are evaluating wicket to rewrite our consumer UI.
>
> There is one requirement in which I would like to get advice on.
>
> We have a requirement in which the wildcard url gets dispatched to a
> controller that renders a page. The url pattern is in the form of
> "/company/**-details.html".
>
> We have a single controller that receives the above url and figures out the
> company name and displays the page accordingly or throws a http 404 error if
> the company is not found.
>
> e.g /company/ABC-details.html, /company/TOTO-details.html etc
>
> Can this be done in wicket?
>
> Any advice or hints would be appreciated!
>
> Dinp
>

Re: URL rewriting

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I am not sure but maybe one simple way is to
    mountBookmarkablePage("/company", CompanyHandler.class);

and then perform uour stuff in CompanyHandler, look at the request url etc.

**
Martin


2009/4/10 DV <hu...@yahoo.com>:
>
> We are evaluating wicket to rewrite our consumer UI.
>
> There is one requirement in which I would like to get advice on.
>
> We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of "/company/**-details.html".
>
> We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found.
>
> e.g /company/ABC-details.html, /company/TOTO-details.html etc
>
> Can this be done in wicket?
>
> Any advice or hints would be appreciated!
>
> Dinp
>
>
>
>
> ---------------------------------------------------------------------
> 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: URL rewriting

Posted by DV <hu...@yahoo.com>.
Thanks for the responses. 3 decent responses within an hour or two. I'm impressed. The reputation about this group is definitely a plus in my evaluation.


--- On Fri, 4/10/09, David Brown <db...@sexingtechnologies.com> wrote:

> From: David Brown <db...@sexingtechnologies.com>
> Subject: Re: URL rewriting
> To: users@wicket.apache.org, hucmuc@yahoo.com
> Date: Friday, April 10, 2009, 10:17 AM
> Hello, one thing you could do is to not worry with Wicket
> doing this but instead allow a proxy to do this for you such
> as Squid with the very good Squid URL rewriting engine. I
> think even Apache has some very good URL rewriting
> configurations. Just an idea, David.
> 
> 
> 
> 
> There are 10 kinds of people in this world: those who
> understand binary and those who don’t (Valid only for
> 2's complement).
> 
> ----- Original Message -----
> From: "DV" <hu...@yahoo.com>
> To: users@wicket.apache.org
> Sent: Friday, April 10, 2009 10:11:24 AM GMT -06:00
> US/Canada Central
> Subject: URL rewriting
> 
> 
> We are evaluating wicket to rewrite our consumer UI.
> 
> There is one requirement in which I would like to get
> advice on.
> 
> We have a requirement in which the wildcard url gets
> dispatched to a controller that renders a page. The url
> pattern is in the form of
> "/company/**-details.html".
> 
> We have a single controller that receives the above url and
> figures out the company name and displays the page
> accordingly or throws a http 404 error if the company is not
> found.
> 
> e.g /company/ABC-details.html, /company/TOTO-details.html
> etc
> 
> Can this be done in wicket?
> 
> Any advice or hints would be appreciated!
> 
> Dinp
> 
> 
>       
> 
> ---------------------------------------------------------------------
> 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: URL rewriting

Posted by David Brown <db...@sexingtechnologies.com>.
Hello, one thing you could do is to not worry with Wicket doing this but instead allow a proxy to do this for you such as Squid with the very good Squid URL rewriting engine. I think even Apache has some very good URL rewriting configurations. Just an idea, David.




There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement).

----- Original Message -----
From: "DV" <hu...@yahoo.com>
To: users@wicket.apache.org
Sent: Friday, April 10, 2009 10:11:24 AM GMT -06:00 US/Canada Central
Subject: URL rewriting


We are evaluating wicket to rewrite our consumer UI.

There is one requirement in which I would like to get advice on.

We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of "/company/**-details.html".

We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found.

e.g /company/ABC-details.html, /company/TOTO-details.html etc

Can this be done in wicket?

Any advice or hints would be appreciated!

Dinp


      

---------------------------------------------------------------------
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