You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Simon B <si...@gmail.com> on 2014/03/10 16:40:06 UTC
mounting // mapping subdomain HomePage
Hi,
I want one instance of Wicket to handle different subdomains, so for
example:
http://mydomain.com/
http://www.mydomain.com/
Map to GeneralHomePage.class
and http://foo.mydomain.com/
Maps to FooHomePage.class
and http://bar.mydomain.com/
Maps to BarHomePage.class
sorry for the unoriginal naming.
If anyone could suggest the best way to do this I'd be very grateful.
Cheers
Simon
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/mounting-mapping-subdomain-HomePage-tp4664880.html
Sent from the Users forum 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: mounting // mapping subdomain HomePage
Posted by Simon B <si...@gmail.com>.
Thanks Martin for your quick reply.
I took your advice and came up with the following implementation which seems
to work well on my development box.
But as it is the root mapper I'd appreciate it if you or someone could just
look over it to make sure its robust.
I instantiate it in the MyApplication#init() method with the following:
If anyone can see an issue with this implementation please let me know.
Cheers
Simon
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/mounting-mapping-subdomain-HomePage-tp4664880p4664897.html
Sent from the Users forum 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: mounting // mapping subdomain HomePage
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
Create a new IRequestMapper and setup it as a root mapper (see HttpsMapper
and CryptoMapper for example).
If the request's Url has no segments then use the HttpServletRequest
(request.getContainerObjec()) to read the host and from this decide which
page to return (new RenderPageRequestHandler(new
PageProvider(SomePage.class)))
Martin Grigorov
Wicket Training and Consulting
On Mon, Mar 10, 2014 at 5:40 PM, Simon B <si...@gmail.com> wrote:
> Hi,
>
> I want one instance of Wicket to handle different subdomains, so for
> example:
>
> http://mydomain.com/
> http://www.mydomain.com/
> Map to GeneralHomePage.class
>
> and http://foo.mydomain.com/
> Maps to FooHomePage.class
>
> and http://bar.mydomain.com/
> Maps to BarHomePage.class
>
> sorry for the unoriginal naming.
>
> If anyone could suggest the best way to do this I'd be very grateful.
>
> Cheers
> Simon
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/mounting-mapping-subdomain-HomePage-tp4664880.html
> Sent from the Users forum 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
>
>