Thanks martin this is exactly what I was looking for.
-----Original Message-----
From: "Martin Grigorov-4 [via Apache Wicket]" 
<ml-node+s1842946n3924434...@n4.nabble.com>
Date: Thu, 20 Oct 2011 23:41:54 
To: anantasthana<anant.a...@gmail.com>
Subject: Re: Request mapping



Application#getHomePage() can be dynamic:

@Override
public Class<? extends Page> getHomePage() {
   if (MySession.get().isLoggedIn()) {
      return AuthenticatedHomePage.class;
   } else {
    return NonAuthenticatedHomePage.class;
   }
}

mountPage("/", NonAuthenticatedHomePage.class);
mountPage("/${userId}/home", AuthenticatedHomePage.class);
mountPage("/${userId}/admin", AdminPage.class);

used with:
PageParameters params = new PageParameters();
if (MySession.get().isLoggedIn()) {
   String userId = MySession.get().getUser().getId();
   params.set("userId", userId);
}
linkToHome = new BookmarkablePageLink<Void>("someId",
getApplication().getHomePage(), params);

On Thu, Oct 20, 2011 at 10:36 PM, anantasthana <anant.a...@gmail.com> wrote:
> I am trying to map my requests in a special way to achieve a very simple
> purpose
>
> say the root website is abc.com and has several users and each use has a
> home page , admin page , requests page etc
> let us asume we have uers user1 and user 2
> i want the urls to be coded as
>
> abc.com/user1/admin
>
> abc.com/user1/home
>
> abc.com/user1/requests
>
> so basicaly abc.com/user1/home is the home page for user 1 and
> abc.com/user1/admin is the the admin page for user 1
>
> any help is welcome.
> Thanks
> Anant
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Request-mapping-tp3923220p3923220.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



_______________________________________________
If you reply to this email, your message will be added to the discussion below:
http://apache-wicket.1842946.n4.nabble.com/Request-mapping-tp3923220p3924434.html

To unsubscribe from Request mapping, visit 
http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3923220&code=YW5hbnQuYXN0eUBnbWFpbC5jb218MzkyMzIyMHwxOTU2OTQ5NjMy


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Request-mapping-tp3923220p3924436.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to