On 11/24/06, Robert McClay <[EMAIL PROTECTED]> wrote:
> I have an app that has a public section and a logged-in section. If the
> session expires for a logged-in user, I'd like to direct him to the
> login. If a page expires for a public user, I'd like to direct him to
> the "/" page. Any thoughts on how to handle this efficently? One "easy"
> way would be to break the app into 2 apps, 2 separate WicketServlets,
> each with its own HomePage defined, but that may use too many resources
> just to accomplish this.
Hrm, that's a special one. First thing that pops up is to use a cookie
to recognize whether the last use of the site was for a logged-in user
or not - you obviously don't have your normal session anymore to get
that back. And once you know that info, you can decide where to
redirect
Application.get().getSecuritySettings().setUnauthorizedComponentInstantiationListener(new
IUnauthorizedComponentInstantiationListener() {
public void onUnauthorizedInstantiation(final Component component) {
// get cookie info
if (wasLoggedIn) throw new RestartResponseException(TheLoginPage.class);
else throw new RestartResponseException(Application.get().getHomePage());
Something like that.
Eelco
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user