Try using a "normal" Link instead of PageLink and do the
setResponsePage stuff in the onClick.

Maurice

On Jan 13, 2008 9:41 PM, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> For the record: I can't smell or magically see what you do in your
> call to super().
>
> I tried it in an application here, and I haven't reproduced your
> problem. It works here.
>
> As long as you don't share the whole code, I have to assume that what
> I can validate on my side is your problem. setResponsePage(new
> LoginPage()) gives me the session expired page.
> setResponsePage(LoginPage.class) doesn't. I also ensured that the
> session is actually invalidated, and that I did have a session prior
> to invalidating.
>
>
> Martijn
>
> On 1/13/08, Anders Peterson <[EMAIL PROTECTED]> wrote:
> > I have never done "new LoginPage()", and I never said I did - that's 
> > something
> > you assumed. It has always been "LoginPage.class".
> >
> > In my original code the "LoginPage.class" was passed as an argument to the
> > PageLink constructor and then I had an onClick method like this:
> >
> >  >>>> public void onClick() {
> >  >>>>         super.onClick();
> >  >>>>         this.setRedirect(true);
> >  >>>>         this.getSession().invalidate();
> >  >>>> }
> >
> > Is that the problem: Do I have to call
> >
> > this.setResponsePage(LoginPage.class);
> >
> > after
> >
> > super.onClick();
> >
> > ?
> >
> > (Don't have access to the code at the moment.)
> >
> > /Anders
> >
> >
> > Martijn Dashorst wrote:
> > > If you read my previous message closely you would have seen:
> > >
> > > setResponsePage(LoginPage.class);
> > >
> > > "LoginPage.class" instead of "new LoginPage()"
> > >
> > > That generates the difference between a bookmarkable URL and a session
> > > relative URL.
> > >
> > > Martijn
> > >
> > > On 1/13/08, Anders Peterson <[EMAIL PROTECTED]> wrote:
> > >> Then where do I call that invalidation code?
> > >>
> > >> It's not possible to override onClick() with BookmarkablePageLink.
> > >>
> > >> /Anders
> > >>
> > >> Martijn Dashorst wrote:
> > >>> You *MUST* redirect to a bookmarkable page, not a page instance. A
> > >>> page instance is always relative to your current session, which you
> > >>> just conveniently invalidated.
> > >>>
> > >>> Martijn
> > >>>
> > >>> On 1/13/08, Anders Peterson <[EMAIL PROTECTED]> wrote:
> > >>>> Doesn't work for me...
> > >>>>
> > >>>> I have a PageLink class with a onClick() method that looks like this:
> > >>>>
> > >>>> public void onClick() {
> > >>>>         super.onClick();
> > >>>>         this.setRedirect(true);
> > >>>>         this.getSession().invalidate();
> > >>>> }
> > >>>>
> > >>>> super.onClick(); sets the response page.
> > >>>>
> > >>>>
> > >>>> I do not end up with the desired login page, but get "Page Expired".
> > >>>>
> > >>>> /Anders
> > >>>>
> > >>>>
> > >>>> Martijn Dashorst wrote:
> > >>>>> iirc:
> > >>>>>
> > >>>>> setResponsePage(LoginPage.class);
> > >>>>> setRedirect(true);
> > >>>>> getSession().invalidate();
> > >>>>>
> > >>>>> Martijn
> > >>>>>
> > >>>>> On 1/13/08, Anders Peterson <[EMAIL PROTECTED]> wrote:
> > >>>>>> I have a related question. What should I do when the user logs out.
> > >>>>>> Currently I just set "username" to null and redirect to the original
> > >>>>>> login page. I feel I also should invalidate the session but that 
> > >>>>>> doesn't
> > >>>>>> work.  Then I always end up with a "Page Expired" page. I'd like to
> > >>>>>> still end up with the login page.
> > >>>>>>
> > >>>>>> /Anders
> > >>>>>>
> > >>>>>> Martijn Dashorst wrote:
> > >>>>>>> Have one session that knows when authentication has happened...
> > >>>>>>>
> > >>>>>>> public MySession extends WebSession {
> > >>>>>>>     private String username;
> > >>>>>>>
> > >>>>>>>     public void setUsername(....){}
> > >>>>>>>
> > >>>>>>>     public boolean isAuthenticated() {
> > >>>>>>>         return username != null;
> > >>>>>>>     }
> > >>>>>>> }
> > >>>>>>>
> > >>>>>>> Then in your web page you can do:
> > >>>>>>>
> > >>>>>>> if (!((MySession)getSession).isAuthenticated()) throw
> > >>>>>>> restartrequestatinterceptpage(...);
> > >>>>>>>
> > >>>>>>> Martijn
> > >>>>>>> On Jan 13, 2008 7:21 AM, xdirewolfx <[EMAIL PROTECTED]> wrote:
> > >>>>>>>> Assume I have created 2 different sessions:
> > >>>>>>>>  - standard session
> > >>>>>>>>  - authenticated session
> > >>>>>>>>
> > >>>>>>>> I have a class MyWebPage with this method:
> > >>>>>>>>  - MyWebPage(boolean isAuthenticated) : true = request 
> > >>>>>>>> authentication
> > >>>>>>>>
> > >>>>>>>> how do I do this programmatically?
> > >>>>>>>> --
> > >>>>>>>> View this message in context: 
> > >>>>>>>> http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.html
> > >>>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> ---------------------------------------------------------------------
> > >>>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>> ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>>>>
> > >>>>>>
> > >>>> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>>
> > >>>>
> > >>>
> > >>
> > >> --
> > >> http://ojalgo.org/
> > >>
> > >> Mathematics, Linear Algebra and Optimisation with Java
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > >
> >
> >
> > --
> > http://ojalgo.org/
> >
> > Mathematics, Linear Algebra and Optimisation with Java
> >
> > ---------------------------------------------------------------------
> > 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 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to