You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2010/09/15 00:32:24 UTC

Prevent guest session from expiring

Hello,

A lot of times the users visit my web site without logging in. Currently,
their session expire after a certain timeout. How can I prevent guest
session from expiring?

Also, where do I specify the page where the logged-in users get redirected
when their sessions expire?

Thanks

RE: Opening a modal form from another modal form causes "are you sure?"

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
>you would have to rerender modal A i think, you need to reestablish
>the hierarchy on server-side
>
>-igor

That's not so bad - it's kind of what I need to do anyway, because form
A needs to be rerendered to update labels that are populated by model
objects created/edited in B.

Is it just a matter of 

remove(formA);
add(formA);

to do the rerender?

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


RE: Opening a modal form from another modal form causes "are you sure?"

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
>you would have to rerender modal A i think, you need to reestablish
>the hierarchy on server-side

I've tried quite a few different methods for rerendering Modal A but
none of them work as required.

Is there a simple couple of lines that would do such a rerender of the
ModalWindow?

>
>-igor

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


Re: Opening a modal form from another modal form causes "are you sure?"

Posted by Igor Vaynberg <ig...@gmail.com>.
you would have to rerender modal A i think, you need to reestablish
the hierarchy on server-side

-igor

On Tue, Sep 14, 2010 at 11:01 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
>>> All my modal windows use a single instance of ModalWindow that is
>>> instantiated in the base page and reused for all modal windows -
>>> hopefully that is ok.
>>
>>no, thats the problem. when modal B shows it removes the panel that
>>was inside modal A out of component hieararchy. so when you click
>>submit on modal A after modal B has been opened that button is no
>>longer in the component hierarchy and thus the error.
>
> Doh! Reusing a single ModalWindow was my "genius" plan for a simple,
> reusable Modal Window architecture.
>
> Is there a way to 're-establish' modal A's ModalWindow in the hierarchy
> after Form B is closed? Apparently it's only not visible in Wicket's
> hierarchy - the form appears to still be in the DOM hierarchy because
> the form is still present in the browser.
>
> I have a modal close listener. Could I somehow reestablish Modal A in
> the wicket hierarchy when the listener callback is called?
>
>
> ---------------------------------------------------------------------
> 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: Opening a modal form from another modal form causes "are you sure?"

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
>> All my modal windows use a single instance of ModalWindow that is
>> instantiated in the base page and reused for all modal windows -
>> hopefully that is ok.
>
>no, thats the problem. when modal B shows it removes the panel that
>was inside modal A out of component hieararchy. so when you click
>submit on modal A after modal B has been opened that button is no
>longer in the component hierarchy and thus the error.

Doh! Reusing a single ModalWindow was my "genius" plan for a simple,
reusable Modal Window architecture.

Is there a way to 're-establish' modal A's ModalWindow in the hierarchy
after Form B is closed? Apparently it's only not visible in Wicket's
hierarchy - the form appears to still be in the DOM hierarchy because
the form is still present in the browser. 

I have a modal close listener. Could I somehow reestablish Modal A in
the wicket hierarchy when the listener callback is called?


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


Re: Opening a modal form from another modal form causes "are you sure?"

Posted by Igor Vaynberg <ig...@gmail.com>.
On Tue, Sep 14, 2010 at 10:41 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> From a panel on a page I open modal form A. If I close this form via its
> OK button it closes without issue.
>
> However if I open modal form A then click "add item" on that form it
> opens up yet another modal form (stacked form?) so the user can edit the
> item. They click on form B's OK buttom and everything is fine ... until
> the first form, Form A is closed again via its OK button. This time Form
> A closes with the message:
>
> "Are you sure you want to navigate away from this page?
>
> Reloading this page will cause the modal window to disappear.
>
> Press OK to continue, or Cancel to stay on the current page."
>
> And then displays this error message/stack:
>
> WicketMessage: Submit Button ok (path=body:modalWindow:content:form:ok)
> is not visible
>
> Root cause:
>
> org.apache.wicket.WicketRuntimeException: Submit Button ok
> (path=body:modalWindow:content:form:ok) is not visible
> at org.apache.wicket.markup.html.form.Form$2.component(Form.java:622)
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:899
> )
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
> )
> at
> org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:6
> 04)
> at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:899)
> at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmi
> tBehavior.java:135)
> at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:
> 177)
> at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef
> aultAjaxBehavior.java:300)
> at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarge
> t.processEvents(BehaviorRequestTarget.java:119)
> at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab
> stractRequestCycleProcessor.java:92)
> at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
> :1250)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484
> )
> at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:
> 317)
> at
> com.sas.av.ui.wicket.templates.original.PagebloomFilter.doFilter(Pageblo
> omFilter.java:95)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:206)
> at
> com.sas.framework.expojo.servlet.ExpojoServletFilter.doFilter(ExpojoServ
> letFilter.java:201)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:206)
> at com.sas.util.web.StaticResponseHeaderFilter.doFilter(Unknown Source)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
> e.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
> e.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :102)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568
> )
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
> 86)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
> 5)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
>
>
>
> All my modal windows use a single instance of ModalWindow that is
> instantiated in the base page and reused for all modal windows -
> hopefully that is ok.

no, thats the problem. when modal B shows it removes the panel that
was inside modal A out of component hieararchy. so when you click
submit on modal A after modal B has been opened that button is no
longer in the component hierarchy and thus the error.

-igor
>
> ---------------------------------------------------------------------
> 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


Opening a modal form from another modal form causes "are you sure?"

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
>From a panel on a page I open modal form A. If I close this form via its
OK button it closes without issue.

However if I open modal form A then click "add item" on that form it
opens up yet another modal form (stacked form?) so the user can edit the
item. They click on form B's OK buttom and everything is fine ... until
the first form, Form A is closed again via its OK button. This time Form
A closes with the message:

"Are you sure you want to navigate away from this page?

Reloading this page will cause the modal window to disappear.

Press OK to continue, or Cancel to stay on the current page."

And then displays this error message/stack:

WicketMessage: Submit Button ok (path=body:modalWindow:content:form:ok)
is not visible

Root cause:

org.apache.wicket.WicketRuntimeException: Submit Button ok
(path=body:modalWindow:content:form:ok) is not visible
at org.apache.wicket.markup.html.form.Form$2.component(Form.java:622)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:899
)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:914
)
at
org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:6
04)
at
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:899)
at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmi
tBehavior.java:135)
at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:
177)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef
aultAjaxBehavior.java:300)
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarge
t.processEvents(BehaviorRequestTarget.java:119)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab
stractRequestCycleProcessor.java:92)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484
)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:
317)
at
com.sas.av.ui.wicket.templates.original.PagebloomFilter.doFilter(Pageblo
omFilter.java:95)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
at
com.sas.framework.expojo.servlet.ExpojoServletFilter.doFilter(ExpojoServ
letFilter.java:201)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
at com.sas.util.web.StaticResponseHeaderFilter.doFilter(Unknown Source)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
86)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)



All my modal windows use a single instance of ModalWindow that is
instantiated in the base page and reused for all modal windows -
hopefully that is ok.

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


Re: Prevent guest session from expiring

Posted by Alec Swan <al...@gmail.com>.
I did not do any session binding. Do you mean binding HttpSession to Wicket
session? What negative side effects will it have? Any docs on this?

Thanks

On Thu, Sep 30, 2010 at 3:30 AM, Martijn Dashorst <
martijn.dashorst@gmail.com> wrote:

> did you bind the session?
>
> On Wed, Sep 29, 2010 at 6:52 PM, Alec Swan <al...@gmail.com> wrote:
> > Hello,
> >
> > I decided to set  MaxInactiveInterval to 0 in onAfterRender in order to
> > prevent guest sessions from expiring. So, my code looks like this:
> >
> > @Override
> >    protected void onAfterRender() {
> >        super.onAfterRender();
> >       ((ServletWebRequest)
> >
> this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0);
> > }
> >
> > However, this does not work because for some reason a new
> > getRequest().getHttpServletRequest().getSession().session object every
> time
> > onAfterRender() is called, e.g. if I refresh the page.
> >
> > Why am I getting StandardSession objects with different ids in
> > onAfterRender()?
> >
> > Thanks
> >
> > On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
> >
> >> Wicket Session is stored in HttpSession.
> >> See
> >>
> >>
> http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29
> >>
> >> On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan <al...@gmail.com> wrote:
> >>
> >> > Are there any methods I can override in Wicket WebSession to make it
> >> never
> >> > expire?
> >> >
> >> > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi <
> >> > martin.makundi@koodaripalvelut.com> wrote:
> >> >
> >> > > You can set session timeout per-session:
> >> > >
> >> > >    ((ServletWebRequest)
> >> > >
> >> > >
> >> >
> >>
> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);
> >> > >
> >> > > **
> >> > > Martin
> >> > >
> >> > > 2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
> >> > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com>
> >> > wrote:
> >> > > >
> >> > > >> Isn't there a way to instruct Wicket not to create a session if
> the
> >> > user
> >> > > is
> >> > > >> not logged in?
> >> > > >>
> >> > > >
> >> > > > a session will always be created.  it won't be bound (and
> therefore
> >> > > stored)
> >> > > > if you have all stateless pages - which isn't an easy task
> >> > > >
> >> > > > --
> >> > > > Jeremy Thomerson
> >> > > > http://www.wickettraining.com
> >> > > >
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > > For additional commands, e-mail: users-help@wicket.apache.org
> >> > >
> >> > >
> >> >
> >>
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.4 increases type safety for web applications
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Prevent guest session from expiring

Posted by Martijn Dashorst <ma...@gmail.com>.
did you bind the session?

On Wed, Sep 29, 2010 at 6:52 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> I decided to set  MaxInactiveInterval to 0 in onAfterRender in order to
> prevent guest sessions from expiring. So, my code looks like this:
>
> @Override
>    protected void onAfterRender() {
>        super.onAfterRender();
>       ((ServletWebRequest)
> this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0);
> }
>
> However, this does not work because for some reason a new
> getRequest().getHttpServletRequest().getSession().session object every time
> onAfterRender() is called, e.g. if I refresh the page.
>
> Why am I getting StandardSession objects with different ids in
> onAfterRender()?
>
> Thanks
>
> On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> Wicket Session is stored in HttpSession.
>> See
>>
>> http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29
>>
>> On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan <al...@gmail.com> wrote:
>>
>> > Are there any methods I can override in Wicket WebSession to make it
>> never
>> > expire?
>> >
>> > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi <
>> > martin.makundi@koodaripalvelut.com> wrote:
>> >
>> > > You can set session timeout per-session:
>> > >
>> > >    ((ServletWebRequest)
>> > >
>> > >
>> >
>> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);
>> > >
>> > > **
>> > > Martin
>> > >
>> > > 2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
>> > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com>
>> > wrote:
>> > > >
>> > > >> Isn't there a way to instruct Wicket not to create a session if the
>> > user
>> > > is
>> > > >> not logged in?
>> > > >>
>> > > >
>> > > > a session will always be created.  it won't be bound (and therefore
>> > > stored)
>> > > > if you have all stateless pages - which isn't an easy task
>> > > >
>> > > > --
>> > > > Jeremy Thomerson
>> > > > http://www.wickettraining.com
>> > > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > > For additional commands, e-mail: users-help@wicket.apache.org
>> > >
>> > >
>> >
>>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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


Re: Prevent guest session from expiring

Posted by Alec Swan <al...@gmail.com>.
Hello,

I decided to set  MaxInactiveInterval to 0 in onAfterRender in order to
prevent guest sessions from expiring. So, my code looks like this:

@Override
    protected void onAfterRender() {
        super.onAfterRender();
       ((ServletWebRequest)
this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0);
}

However, this does not work because for some reason a new
getRequest().getHttpServletRequest().getSession().session object every time
onAfterRender() is called, e.g. if I refresh the page.

Why am I getting StandardSession objects with different ids in
onAfterRender()?

Thanks

On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov <mg...@apache.org>wrote:

> Wicket Session is stored in HttpSession.
> See
>
> http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29
>
> On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan <al...@gmail.com> wrote:
>
> > Are there any methods I can override in Wicket WebSession to make it
> never
> > expire?
> >
> > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi <
> > martin.makundi@koodaripalvelut.com> wrote:
> >
> > > You can set session timeout per-session:
> > >
> > >    ((ServletWebRequest)
> > >
> > >
> >
> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);
> > >
> > > **
> > > Martin
> > >
> > > 2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
> > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com>
> > wrote:
> > > >
> > > >> Isn't there a way to instruct Wicket not to create a session if the
> > user
> > > is
> > > >> not logged in?
> > > >>
> > > >
> > > > a session will always be created.  it won't be bound (and therefore
> > > stored)
> > > > if you have all stateless pages - which isn't an easy task
> > > >
> > > > --
> > > > Jeremy Thomerson
> > > > http://www.wickettraining.com
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>

Re: Prevent guest session from expiring

Posted by Martin Grigorov <mg...@apache.org>.
Wicket Session is stored in HttpSession.
See
http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29

On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan <al...@gmail.com> wrote:

> Are there any methods I can override in Wicket WebSession to make it never
> expire?
>
> On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
> > You can set session timeout per-session:
> >
> >    ((ServletWebRequest)
> >
> >
> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);
> >
> > **
> > Martin
> >
> > 2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
> > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com>
> wrote:
> > >
> > >> Isn't there a way to instruct Wicket not to create a session if the
> user
> > is
> > >> not logged in?
> > >>
> > >
> > > a session will always be created.  it won't be bound (and therefore
> > stored)
> > > if you have all stateless pages - which isn't an easy task
> > >
> > > --
> > > Jeremy Thomerson
> > > http://www.wickettraining.com
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Prevent guest session from expiring

Posted by Alec Swan <al...@gmail.com>.
Are there any methods I can override in Wicket WebSession to make it never
expire?

On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:

> You can set session timeout per-session:
>
>    ((ServletWebRequest)
>
> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);
>
> **
> Martin
>
> 2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
> > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com> wrote:
> >
> >> Isn't there a way to instruct Wicket not to create a session if the user
> is
> >> not logged in?
> >>
> >
> > a session will always be created.  it won't be bound (and therefore
> stored)
> > if you have all stateless pages - which isn't an easy task
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Prevent guest session from expiring

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
You can set session timeout per-session:

    ((ServletWebRequest)
request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds);

**
Martin

2010/9/15 Jeremy Thomerson <je...@wickettraining.com>:
> On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com> wrote:
>
>> Isn't there a way to instruct Wicket not to create a session if the user is
>> not logged in?
>>
>
> a session will always be created.  it won't be bound (and therefore stored)
> if you have all stateless pages - which isn't an easy task
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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


Re: Prevent guest session from expiring

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan <al...@gmail.com> wrote:

> Isn't there a way to instruct Wicket not to create a session if the user is
> not logged in?
>

a session will always be created.  it won't be bound (and therefore stored)
if you have all stateless pages - which isn't an easy task

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

Re: Prevent guest session from expiring

Posted by Alec Swan <al...@gmail.com>.
Isn't there a way to instruct Wicket not to create a session if the user is
not logged in?

On Tue, Sep 14, 2010 at 5:21 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> a noop ajax poller on your base page will prevent sessions of open
> windows from expiring.
>
> -igor
>
> On Tue, Sep 14, 2010 at 3:32 PM, Alec Swan <al...@gmail.com> wrote:
> > Hello,
> >
> > A lot of times the users visit my web site without logging in. Currently,
> > their session expire after a certain timeout. How can I prevent guest
> > session from expiring?
> >
> > Also, where do I specify the page where the logged-in users get
> redirected
> > when their sessions expire?
> >
> > Thanks
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Prevent guest session from expiring

Posted by Igor Vaynberg <ig...@gmail.com>.
a noop ajax poller on your base page will prevent sessions of open
windows from expiring.

-igor

On Tue, Sep 14, 2010 at 3:32 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> A lot of times the users visit my web site without logging in. Currently,
> their session expire after a certain timeout. How can I prevent guest
> session from expiring?
>
> Also, where do I specify the page where the logged-in users get redirected
> when their sessions expire?
>
> Thanks
>

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


Re: Prevent guest session from expiring

Posted by Alec Swan <al...@gmail.com>.
Jeremy,

getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) is
what I was looking for.

I don't think I can use session timeout in web.xml because I want sessions
of logged-in users to expire and guest sessions - not to expire.

Thoughts?

On Tue, Sep 14, 2010 at 5:06 PM, Jeremy Thomerson <jeremy@wickettraining.com
> wrote:

> On Tue, Sep 14, 2010 at 5:32 PM, Alec Swan <al...@gmail.com> wrote:
>
> > Hello,
> >
> > A lot of times the users visit my web site without logging in. Currently,
> > their session expire after a certain timeout. How can I prevent guest
> > session from expiring?
> >
>
> session timeout is configured by your container
>
>
> > Also, where do I specify the page where the logged-in users get
> redirected
> > when their sessions expire?
> >
>
> getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) will
> change where they go if they click a link on a page that has been expired
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

Re: Prevent guest session from expiring

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Sep 14, 2010 at 5:32 PM, Alec Swan <al...@gmail.com> wrote:

> Hello,
>
> A lot of times the users visit my web site without logging in. Currently,
> their session expire after a certain timeout. How can I prevent guest
> session from expiring?
>

session timeout is configured by your container


> Also, where do I specify the page where the logged-in users get redirected
> when their sessions expire?
>

getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) will
change where they go if they click a link on a page that has been expired

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