You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bert <ta...@gmail.com> on 2010/09/23 08:59:16 UTC

Hiding parts of the path

Hi list,

i want to services the same app using different (but structural
identical) databases.
say:

http://foo.org/site/alpha
http://foo.org/site/beta
http://foo.org/site/ceti
...

I have managed to get JPA working with an routing datasource, to
switch the database
depending on the url path.

Now i need to tell Wicket that it should basically ignore those extra
alpha, beta,.. path
component when looking up the request target and add it back when
generating urls.

So, for Wicket, an incoming URL of http://foo.org/site/alpha/page1
should be treated as
http://foo.org/site/site1. Of course, generated URL should include the
extra information...

My first idea was to overwrite the WicketFilter.getRelativePath() and
remove the extra
path component. This did not work.

Any other idea? Would an UrlCodingStrategy help?

thanks in advance
Bert

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


Re: Hiding parts of the path

Posted by Igor Vaynberg <ig...@gmail.com>.
you can try writing your own webrequestcodingstrategy, but be careful
not to break relative urls.

-igor

On Wed, Sep 22, 2010 at 11:59 PM, Bert <ta...@gmail.com> wrote:
> Hi list,
>
> i want to services the same app using different (but structural
> identical) databases.
> say:
>
> http://foo.org/site/alpha
> http://foo.org/site/beta
> http://foo.org/site/ceti
> ...
>
> I have managed to get JPA working with an routing datasource, to
> switch the database
> depending on the url path.
>
> Now i need to tell Wicket that it should basically ignore those extra
> alpha, beta,.. path
> component when looking up the request target and add it back when
> generating urls.
>
> So, for Wicket, an incoming URL of http://foo.org/site/alpha/page1
> should be treated as
> http://foo.org/site/site1. Of course, generated URL should include the
> extra information...
>
> My first idea was to overwrite the WicketFilter.getRelativePath() and
> remove the extra
> path component. This did not work.
>
> Any other idea? Would an UrlCodingStrategy help?
>
> thanks in advance
> Bert
>
> ---------------------------------------------------------------------
> 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