Re: Returning to the original page after session timeout / login

2009-06-12 Thread Johan Compagner
What you describe i already replied
Thats the hybrid approache if pages can be stateless then wicket can
generate already urls that can generate the page again if expired and
the call the event

On 12/06/2009, Martin Sachs  wrote:
> I wonder why this is so a big problem. On bookmarkable Webpages (e.g.
> Productpages) the user dont need to login and the session can destroyed
> via timeout. Each Ajax-Request throw would throw a PageExpiredException.
> This is the worst thing in wicket, IMHO.
>
> My tryout was the following in a quickstart-project:
>
> I modified the Homepage:
>
> public class HomePage extends WebPage {
>
>   private static final long serialVersionUID = 1L;
>
>   // TODO Add any page properties or variables here
>   private int   i= 0;
>
>   /**
>* Constructor that is invoked when page is invoked without a session.
>*
>* @param parameters
>*  Page parameters
>*/
>   public HomePage(final PageParameters parameters) {
>
> // Add the simplest type of label
> final Label label = new Label("message", "If you see this message
> wicket is properly configured and running" + i);
> label.setOutputMarkupId(true);
> add(label);
> setStatelessHint(true);
> setVersioned(false);
>
> AjaxEventBehavior ajaxEventBehavior = new AjaxEventBehavior("onclick") {
>
>   @Override
>   protected CharSequence getCallbackScript() {
> return super.getCallbackScript() + ";return false;";
>   }
>
>   @Override
>   protected void onEvent(AjaxRequestTarget target) {
> i++;
> target.addComponent(label);
>   }
>
> };
> BookmarkablePageLink link = new
> BookmarkablePageLink("link", this.getPageClass());
> link.add(ajaxEventBehavior);
> add(link);
>
>   }
>
>   @Override
>   public boolean isBookmarkable() {
> return true;
>   }
>
>   @Override
>   public boolean isVersioned() {
> return false;
>   }
>
>   @Override
>   public boolean isPageStateless() {
> return true;
>   }
>
> and overide the resolveRenderedPage() -Method of
> WebRequestCycleProcessor to handle the case, if the page is null. I just
> create a Page and call beforeRender on it. So the hierachie was build.
>
> The Ajax-request found a component and it work ! The State is coded in
> URL at bookmarkable pages, so who cares about lost state, just create a
> new one. This could also work for stateless pages, for which i overide
> isPageStateless. The component-hierachie must not be scaned and you can
> use ajax.
>
> Alternative: Maybe you can create a new RequestCycle to handle ajaxcalls
> without creating the hole hierarchie. Just create the panel with the
> state coded in the URL?
>
> What are the reasons for not doing it ?
>
> After login you can use the intercepting mechanism. But is the best why
> to intercept multiple times and return to the originals step by step
> (like stack-beheaviour) ?
>
>
> Martin
>
> Christopher L Merrill schrieb:
>> I've changed out PageExpiredErrorPage to be the login page for our app.
>> Does wicket have any support built-in to help return the user to where
>> they were after re-authenticating?
>>
>> From my modest understanding of Wicket, it would need to be a
>> bookmarkable
>> page, which will be ok for a good percentage of the pages in our system.
>>
>> Any suggestions?
>> TIA!
>> Chris
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Martin Sachs
I wonder why this is so a big problem. On bookmarkable Webpages (e.g.
Productpages) the user dont need to login and the session can destroyed
via timeout. Each Ajax-Request throw would throw a PageExpiredException.
This is the worst thing in wicket, IMHO.

My tryout was the following in a quickstart-project:

I modified the Homepage:

public class HomePage extends WebPage {

  private static final long serialVersionUID = 1L;

  // TODO Add any page properties or variables here
  private int   i= 0;

  /**
   * Constructor that is invoked when page is invoked without a session.
   *
   * @param parameters
   *  Page parameters
   */
  public HomePage(final PageParameters parameters) {

// Add the simplest type of label
final Label label = new Label("message", "If you see this message
wicket is properly configured and running" + i);
label.setOutputMarkupId(true);
add(label);
setStatelessHint(true);
setVersioned(false);

AjaxEventBehavior ajaxEventBehavior = new AjaxEventBehavior("onclick") {

  @Override
  protected CharSequence getCallbackScript() {
return super.getCallbackScript() + ";return false;";
  }

  @Override
  protected void onEvent(AjaxRequestTarget target) {
i++;
target.addComponent(label);
  }

};
BookmarkablePageLink link = new
BookmarkablePageLink("link", this.getPageClass());
link.add(ajaxEventBehavior);
add(link);

  }

  @Override
  public boolean isBookmarkable() {
return true;
  }

  @Override
  public boolean isVersioned() {
return false;
  }

  @Override
  public boolean isPageStateless() {
return true;
  }

and overide the resolveRenderedPage() -Method of
WebRequestCycleProcessor to handle the case, if the page is null. I just
create a Page and call beforeRender on it. So the hierachie was build.

The Ajax-request found a component and it work ! The State is coded in
URL at bookmarkable pages, so who cares about lost state, just create a
new one. This could also work for stateless pages, for which i overide
isPageStateless. The component-hierachie must not be scaned and you can
use ajax.

Alternative: Maybe you can create a new RequestCycle to handle ajaxcalls
without creating the hole hierarchie. Just create the panel with the
state coded in the URL?

What are the reasons for not doing it ?

After login you can use the intercepting mechanism. But is the best why
to intercept multiple times and return to the originals step by step
(like stack-beheaviour) ?


Martin

Christopher L Merrill schrieb:
> I've changed out PageExpiredErrorPage to be the login page for our app.
> Does wicket have any support built-in to help return the user to where
> they were after re-authenticating?
>
> From my modest understanding of Wicket, it would need to be a
> bookmarkable
> page, which will be ok for a good percentage of the pages in our system.
>
> Any suggestions?
> TIA!
> Chris
>
>


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Johan Compagner
Yes if you dont want to have page expires you could try to use
bookmarkable pages all the way and use the hybrid coding to get mixed
book/session pages.

Or store something in the db record the last page for every user...

On 12/06/2009, Jeremy Thomerson  wrote:
> the path is stored in the session, so as long as your app server
> reloads existing sessions on restart, it should (iirc).  however, in
> your dev environment, the app server probably blows away sessions
>
> hr, i just re-read and realized that you said this is for the
> PageExpired which is typically encountered when you lost your
> session - so this won't work for that.  But it will work if I go back
> twenty pages and click a link - not super helpful.  Sorry.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Jun 12, 2009 at 2:13 PM, Christopher L
> Merrill wrote:
>> Wow, I hope it's really that easy!?!
>>
>> Should this work through an appserver restart?  E.g. if I
>> 1) login to the app
>> 2) restart the app server
>> 3) click a page link in the browser
>>
>> Should this work?  It didn't for me.  Based on my limited understanding of
>> how wicket works and stepping into the code, it kinda looks like it might
>> not?
>>
>> Chris
>>
>>
>>
>>
>> Jeremy Thomerson wrote:
>>>
>>> in your login form submit, call continueToOriginalDestination()
>>>
>>> onSubmit() {
>>> if (false == continueToOriginalDestination()) {
>>> setReturnPage(SomeOtherPage.class);
>>> }
>>> }
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Fri, Jun 12, 2009 at 1:45 PM, Christopher L
>>> Merrill wrote:

 I've changed out PageExpiredErrorPage to be the login page for our app.
 Does wicket have any support built-in to help return the user to where
 they were after re-authenticating?

 From my modest understanding of Wicket, it would need to be a
 bookmarkable
 page, which will be ok for a good percentage of the pages in our system.

 Any suggestions?
 TIA!
 Chris


 --
 
 -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Website Load Testing and Stress Testing Software & Services
 
 -


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>>  -
>> Chris Merrill                           |  Web Performance, Inc.
>> ch...@webperformance.com                |  http://webperformance.com
>> 919-433-1762                            |  919-845-7601
>>
>> Website Load Testing and Stress Testing Software & Services
>>  -
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Jeremy Thomerson
Or implement a "remember me" feature in the request cycle.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jun 12, 2009 at 2:38 PM, Jeremy
Thomerson wrote:
> Just lengthen the session timeout - how to do this depends on your
> servlet container.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Jun 12, 2009 at 2:37 PM, Christopher L
> Merrill wrote:
>> Jeremy Thomerson wrote:
>>>
>>> the path is stored in the session, so as long as your app server
>>> reloads existing sessions on restart, it should (iirc).  however, in
>>> your dev environment, the app server probably blows away sessions
>>>
>>> hr, i just re-read and realized that you said this is for the
>>> PageExpired which is typically encountered when you lost your
>>> session - so this won't work for that.  But it will work if I go back
>>> twenty pages and click a link - not super helpful.  Sorry.
>>
>> Ahhh...you had me all excited!   :>
>>
>> So maybe my question is really about controlling session duration.
>> We don't want our user to be forced to re-authenticate throughout the
>> day - so maybe I'm asking the wrong question...Is there another way
>> I should be approaching that problem?
>>
>>
>>
>>
>> --
>>  -
>> Chris Merrill                           |  Web Performance, Inc.
>> ch...@webperformance.com                |  http://webperformance.com
>> 919-433-1762                            |  919-845-7601
>>
>> Website Load Testing and Stress Testing Software & Services
>>  -
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Jeremy Thomerson
Just lengthen the session timeout - how to do this depends on your
servlet container.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jun 12, 2009 at 2:37 PM, Christopher L
Merrill wrote:
> Jeremy Thomerson wrote:
>>
>> the path is stored in the session, so as long as your app server
>> reloads existing sessions on restart, it should (iirc).  however, in
>> your dev environment, the app server probably blows away sessions
>>
>> hr, i just re-read and realized that you said this is for the
>> PageExpired which is typically encountered when you lost your
>> session - so this won't work for that.  But it will work if I go back
>> twenty pages and click a link - not super helpful.  Sorry.
>
> Ahhh...you had me all excited!   :>
>
> So maybe my question is really about controlling session duration.
> We don't want our user to be forced to re-authenticate throughout the
> day - so maybe I'm asking the wrong question...Is there another way
> I should be approaching that problem?
>
>
>
>
> --
>  -
> Chris Merrill                           |  Web Performance, Inc.
> ch...@webperformance.com                |  http://webperformance.com
> 919-433-1762                            |  919-845-7601
>
> Website Load Testing and Stress Testing Software & Services
>  -
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Christopher L Merrill

Jeremy Thomerson wrote:

the path is stored in the session, so as long as your app server
reloads existing sessions on restart, it should (iirc).  however, in
your dev environment, the app server probably blows away sessions

hr, i just re-read and realized that you said this is for the
PageExpired which is typically encountered when you lost your
session - so this won't work for that.  But it will work if I go back
twenty pages and click a link - not super helpful.  Sorry.


Ahhh...you had me all excited!   :>

So maybe my question is really about controlling session duration.
We don't want our user to be forced to re-authenticate throughout the
day - so maybe I'm asking the wrong question...Is there another way
I should be approaching that problem?




--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Jeremy Thomerson
the path is stored in the session, so as long as your app server
reloads existing sessions on restart, it should (iirc).  however, in
your dev environment, the app server probably blows away sessions

hr, i just re-read and realized that you said this is for the
PageExpired which is typically encountered when you lost your
session - so this won't work for that.  But it will work if I go back
twenty pages and click a link - not super helpful.  Sorry.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jun 12, 2009 at 2:13 PM, Christopher L
Merrill wrote:
> Wow, I hope it's really that easy!?!
>
> Should this work through an appserver restart?  E.g. if I
> 1) login to the app
> 2) restart the app server
> 3) click a page link in the browser
>
> Should this work?  It didn't for me.  Based on my limited understanding of
> how wicket works and stepping into the code, it kinda looks like it might
> not?
>
> Chris
>
>
>
>
> Jeremy Thomerson wrote:
>>
>> in your login form submit, call continueToOriginalDestination()
>>
>> onSubmit() {
>> if (false == continueToOriginalDestination()) {
>> setReturnPage(SomeOtherPage.class);
>> }
>> }
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, Jun 12, 2009 at 1:45 PM, Christopher L
>> Merrill wrote:
>>>
>>> I've changed out PageExpiredErrorPage to be the login page for our app.
>>> Does wicket have any support built-in to help return the user to where
>>> they were after re-authenticating?
>>>
>>> From my modest understanding of Wicket, it would need to be a
>>> bookmarkable
>>> page, which will be ok for a good percentage of the pages in our system.
>>>
>>> Any suggestions?
>>> TIA!
>>> Chris
>>>
>>>
>>> --
>>> 
>>> -
>>> Chris Merrill                           |  Web Performance, Inc.
>>> ch...@webperformance.com                |  http://webperformance.com
>>> 919-433-1762                            |  919-845-7601
>>>
>>> Website Load Testing and Stress Testing Software & Services
>>> 
>>> -
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
>  -
> Chris Merrill                           |  Web Performance, Inc.
> ch...@webperformance.com                |  http://webperformance.com
> 919-433-1762                            |  919-845-7601
>
> Website Load Testing and Stress Testing Software & Services
>  -
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Christopher L Merrill

Wow, I hope it's really that easy!?!

Should this work through an appserver restart?  E.g. if I
1) login to the app
2) restart the app server
3) click a page link in the browser

Should this work?  It didn't for me.  Based on my limited understanding of
how wicket works and stepping into the code, it kinda looks like it might
not?

Chris




Jeremy Thomerson wrote:

in your login form submit, call continueToOriginalDestination()

onSubmit() {
if (false == continueToOriginalDestination()) {
setReturnPage(SomeOtherPage.class);
}
}

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jun 12, 2009 at 1:45 PM, Christopher L
Merrill wrote:

I've changed out PageExpiredErrorPage to be the login page for our app.
Does wicket have any support built-in to help return the user to where
they were after re-authenticating?

From my modest understanding of Wicket, it would need to be a bookmarkable
page, which will be ok for a good percentage of the pages in our system.

Any suggestions?
TIA!
Chris


--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Returning to the original page after session timeout / login

2009-06-12 Thread Jeremy Thomerson
in your login form submit, call continueToOriginalDestination()

onSubmit() {
if (false == continueToOriginalDestination()) {
setReturnPage(SomeOtherPage.class);
}
}

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jun 12, 2009 at 1:45 PM, Christopher L
Merrill wrote:
> I've changed out PageExpiredErrorPage to be the login page for our app.
> Does wicket have any support built-in to help return the user to where
> they were after re-authenticating?
>
> From my modest understanding of Wicket, it would need to be a bookmarkable
> page, which will be ok for a good percentage of the pages in our system.
>
> Any suggestions?
> TIA!
> Chris
>
>
> --
>  -
> Chris Merrill                           |  Web Performance, Inc.
> ch...@webperformance.com                |  http://webperformance.com
> 919-433-1762                            |  919-845-7601
>
> Website Load Testing and Stress Testing Software & Services
>  -
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Returning to the original page after session timeout / login

2009-06-12 Thread Christopher L Merrill

I've changed out PageExpiredErrorPage to be the login page for our app.
Does wicket have any support built-in to help return the user to where
they were after re-authenticating?

From my modest understanding of Wicket, it would need to be a bookmarkable
page, which will be ok for a good percentage of the pages in our system.

Any suggestions?
TIA!
Chris


--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org