You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andreas Maza <an...@gmail.com> on 2009/12/13 16:09:55 UTC
URL Rewriting in Wicket
Hello,
I would like to do a simple URL rewriting in my application: All requests
containing a given path (e.g., a "/x/...") should be filtered and redirected
accordingly.
In other words, for a request to http://www.example.com/x/something I want
to do a database lookup based on the value of "something" and then redirect
the user to the appropriate wicket page.
What is the recommended way to do this in wicket? Make a hook into the
WebApplication.newRequestCycle() method?
thanks for your help,
andr
Re: URL Rewriting in Wicket
Posted by "A. Maza" <an...@gmail.com>.
Thanks for the hint. I found out that the IndexedParamUrlCodingStrategy
actually provides exactly what I need...
The fine thing with wicket is that you can realize things really fast -
great job!
regards,
andr
On 14.12.2009 11:26, Erik van Oosten wrote:
> Actually, you should override the WebRequestProcessor and return a
> custom RequestCodingStrategy from there. The custom
> RequestCodingStrategy would extend one of the default implementation and
> override urlCodingStrategyForPath and getRequestPath.
>
> Regards,
> Erik.
>
>
> Andreas Maza wrote:
>> Hello,
>>
>> I would like to do a simple URL rewriting in my application: All requests
>> containing a given path (e.g., a "/x/...") should be filtered and
>> redirected
>> accordingly.
>>
>> In other words, for a request to http://www.example.com/x/something I
>> want
>> to do a database lookup based on the value of "something" and then
>> redirect
>> the user to the appropriate wicket page.
>>
>> What is the recommended way to do this in wicket? Make a hook into the
>> WebApplication.newRequestCycle() method?
>>
>> thanks for your help,
>> andr
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: URL Rewriting in Wicket
Posted by Erik van Oosten <e....@grons.nl>.
Actually, you should override the WebRequestProcessor and return a
custom RequestCodingStrategy from there. The custom
RequestCodingStrategy would extend one of the default implementation and
override urlCodingStrategyForPath and getRequestPath.
Regards,
Erik.
Andreas Maza wrote:
> Hello,
>
> I would like to do a simple URL rewriting in my application: All requests
> containing a given path (e.g., a "/x/...") should be filtered and redirected
> accordingly.
>
> In other words, for a request to http://www.example.com/x/something I want
> to do a database lookup based on the value of "something" and then redirect
> the user to the appropriate wicket page.
>
> What is the recommended way to do this in wicket? Make a hook into the
> WebApplication.newRequestCycle() method?
>
> thanks for your help,
> andr
>
>
--
Erik van Oosten
http://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