I mm trying to test the dumbest example of wicket auth roles, using
examples in 1.4 m3 zip, and just extends pages that can be found
there.

Everytime that I log in, I was expected to be redirected from login to
page that I tried to access, but I am being redirected to the "correct
page", but without the context path, resulting in a page not found.

Could it be a bug?


Dumb Code:
>>>>>>>>>>
RoomBookingApplication.java
public class RoomBookingApplication extends AuthenticatedWebApplication {

    protected void init() {
        super.init();
        mountBookmarkablePage("admin", AdminPage.class);
    }

    public Class<? extends Page> getHomePage() {
        return CalendarPage.class;
    }

    protected Class<? extends AuthenticatedWebSession> getWebSessionClass() {
        return RoomBookingSession.class;
    }

    protected Class<? extends WebPage> getSignInPageClass() {
        return BookingSignInPage.class;
    }

}

RoomBookingSession.java
public class RoomBookingSession extends AuthenticatedWebSession {

    public RoomBookingSession(Request request) {
        super(request);
    }

    public boolean authenticate(String user, String pass) {
        return (user.equals("test") && pass.equals("test"));
    }

    public Roles getRoles() {
        if (isSignedIn())
            return new Roles(Roles.ADMIN);
        return null;
    }
}

CalendarPage.java
public class CalendarPage extends WebPage {
    public CalendarPage() {
        add(new Label("helloWorld","itsworking"));
    }
}

@AuthorizeInstantiation(Roles.ADMIN)
public class AdminPage extends WebPage {
}
<<<<<<<<<<<<<<

if I try to access http://localhost:8080/booking/admin , I am redirect
to login page. If I enter the correct login and pass, I am redirect to
http://localhost:8080/admin


--

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to