Why not:
Application#getHomePage() {
    if(!isUser()) { return AdminPage.class; }
    return UserPage.class;
}

On Dec 16, 2007 2:46 PM, John Krasnay <[EMAIL PROTECTED]> wrote:

> On Sat, Dec 15, 2007 at 08:44:32PM -0800, Cristina wrote:
> >
> > Hello,
> >
> > I'm working on an app where users and admins will perform mutually
> exclusive
> > use cases. That's quite a common situation. It looks like the simpler
> > approach here would be to return one home page with the user menu and
> > another one with the admin menu. The choice would be placed in the Login
> > page and executed according to the profile of the username that's trying
> to
> > access the app.
> >
>
> A technique I've used is to have a dummy home page that just redirects
> to one page or the other:
>
> public class HomePage extends WebPage {
>  public HomePage() {
>    if (isUser()) {
>      setResponsePage(UserHomePage.class);
>    } else {
>      setResponsePage(AdminHomePage.class);
>    }
>  }
> }
>
> You don't even need a HomePage.html file.
>
> jk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/

Reply via email to