You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by xdirewolfx <ke...@gmail.com> on 2008/01/13 07:21:26 UTC
How do you do this in wicket?
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by xdirewolfx <ke...@gmail.com>.
The reason we went for such an approach was because user will design the
look&feel, content and whether it is public or private(authentication
needed) on runtime using view metadata. We used proprietary technology
earlier on and decided to give a short in wicket as it fits better and much
more intuitive. Keep up the good work wicket team.
Martijn Dashorst wrote:
>
> Another option is too look at wicket-auth-roles. It is really simple
> (basically an example) but for a lot of applications it is in the
> sweet spot. Two default roles: user and admin.
>
> The wicket examples have the auth roles examples in them.
>
> Martijn
>
> On Jan 13, 2008 3:31 PM, xdirewolfx <ke...@gmail.com> wrote:
>>
>> Thank you Martijin.
>>
>> Ken
>>
>>
>> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > 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: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14786207.html
>>
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14787020.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
Another option is too look at wicket-auth-roles. It is really simple
(basically an example) but for a lot of applications it is in the
sweet spot. Two default roles: user and admin.
The wicket examples have the auth roles examples in them.
Martijn
On Jan 13, 2008 3:31 PM, xdirewolfx <ke...@gmail.com> wrote:
>
> Thank you Martijin.
>
> Ken
>
>
> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> >
> > --
> > 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14786207.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by xdirewolfx <ke...@gmail.com>.
Thank you Martijin.
Ken
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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14786207.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Maurice Marrink <ma...@gmail.com>.
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 <ma...@gmail.com> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> > >>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>> ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> > >>>>>>
> > >>>>>>
> > >>>> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >>>> For additional commands, e-mail: users-help@wicket.apache.org
> > >>>>
> > >>>>
> > >>>
> > >>
> > >> --
> > >> http://ojalgo.org/
> > >>
> > >> Mathematics, Linear Algebra and Optimisation with Java
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> >
> >
> > --
> > http://ojalgo.org/
> >
> > Mathematics, Linear Algebra and Optimisation with Java
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>>>
> >>>>>>>>
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>
> >>
> >> --
> >> http://ojalgo.org/
> >>
> >> Mathematics, Linear Algebra and Optimisation with Java
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
>
> --
> http://ojalgo.org/
>
> Mathematics, Linear Algebra and Optimisation with Java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Anders Peterson <ap...@optimatika.se>.
Anders Peterson wrote:
> Is that the problem: Do I have to call
>
> this.setResponsePage(LoginPage.class);
>
> after
>
> super.onClick();
>
> ?
Yes, that was it.
Thanks Martijn and Maurice!
/Anders
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Anders Peterson <ap...@optimatika.se>.
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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>
>> --
>> http://ojalgo.org/
>>
>> Mathematics, Linear Algebra and Optimisation with Java
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
--
http://ojalgo.org/
Mathematics, Linear Algebra and Optimisation with Java
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
>
> --
> http://ojalgo.org/
>
> Mathematics, Linear Algebra and Optimisation with Java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Anders Peterson <ap...@optimatika.se>.
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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
--
http://ojalgo.org/
Mathematics, Linear Algebra and Optimisation with Java
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
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 <ap...@optimatika.se> 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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Anders Peterson <ap...@optimatika.se>.
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 <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
iirc:
setResponsePage(LoginPage.class);
setRedirect(true);
getSession().invalidate();
Martijn
On 1/13/08, Anders Peterson <ap...@optimatika.se> 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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Anders Peterson <ap...@optimatika.se>.
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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How do you do this in wicket?
Posted by Martijn Dashorst <ma...@gmail.com>.
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 <ke...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org