You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sylvain <sy...@interview-efm.com> on 2012/06/11 17:01:34 UTC

Exception when Session expired

Hi,

I miragte in wicket 1.5 and I change the run timeException by this code

		getRequestCycleListeners().add(new CommonRequestCycleListener() {
			@Override
			public void onExceptionRequestHandlerResolved(RequestCycle cycle,
IRequestHandler handler, Exception exception) {
				// TODO Auto-generated method stub
				super.onExceptionRequestHandlerResolved(cycle, handler, exception);
			}
			
			@Override
			public IRequestHandler onException(RequestCycle cycle, Exception e) {
				Page page = new ErrorPage(e);
				try {
					.....

					if (e instanceof PageExpiredException) {
						Page expirationPage = getExpirationPage();
					}
				} catch (QuestionnaireOrFormulaireNotFoundException t) {
					page = new QuestionnaireOrFormulaireNotFoundPage();
				} catch (Throwable t) {
					page = new ErrorFormulairePage(t, null);
				}
				return new RenderPageRequestHandler(new PageProvider(page));
			}
		});
	}

it's ok for a lot of error except for the expiration session. 

In wicket 1.4, when my session expired, i had a PageExpiredException but in
wicket 1.5, don't it. 

Have you an idea why? 
How i can catch the exception of the expiration session?

Thanks in advance

Sylvain

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Exception-when-Session-expired-tp4649854.html
Sent from the Users forum 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: Exception when Session expired

Posted by Martin Grigorov <mg...@apache.org>.
Read the conversation in thread "PageExpiredErrorPage not working" we
have at the moment.

On Wed, Jun 13, 2012 at 10:28 AM, sylvain
<sy...@interview-efm.com> wrote:
> Hi Martin,
>
> Yes it's more correct to put this code "page = getExpirationPage()".
>
> But my problem, when my session expire, I never pass in the "onException".
>
> Have you an idea why?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Exception-when-Session-expired-tp4649854p4649913.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Exception when Session expired

Posted by sylvain <sy...@interview-efm.com>.
Hi Martin,

Yes it's more correct to put this code "page = getExpirationPage()". 

But my problem, when my session expire, I never pass in the "onException".

Have you an idea why?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Exception-when-Session-expired-tp4649854p4649913.html
Sent from the Users forum 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: Exception when Session expired

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Mon, Jun 11, 2012 at 6:01 PM, sylvain
<sy...@interview-efm.com> wrote:
> Hi,
>
> I miragte in wicket 1.5 and I change the run timeException by this code
>
>                getRequestCycleListeners().add(new CommonRequestCycleListener() {
>                        @Override
>                        public void onExceptionRequestHandlerResolved(RequestCycle cycle,
> IRequestHandler handler, Exception exception) {
>                                // TODO Auto-generated method stub
>                                super.onExceptionRequestHandlerResolved(cycle, handler, exception);
>                        }
>
>                        @Override
>                        public IRequestHandler onException(RequestCycle cycle, Exception e) {
>                                Page page = new ErrorPage(e);
>                                try {
>                                        .....
>
>                                        if (e instanceof PageExpiredException) {
>                                                Page expirationPage = getExpirationPage();

Here 'expirationPage' is ignored.
Maybe it should be 'page = getExpirationPage()'

>                                        }
>                                } catch (QuestionnaireOrFormulaireNotFoundException t) {
>                                        page = new QuestionnaireOrFormulaireNotFoundPage();
>                                } catch (Throwable t) {
>                                        page = new ErrorFormulairePage(t, null);
>                                }
>                                return new RenderPageRequestHandler(new PageProvider(page));
>                        }
>                });
>        }
>
> it's ok for a lot of error except for the expiration session.
>
> In wicket 1.4, when my session expired, i had a PageExpiredException but in
> wicket 1.5, don't it.
>
> Have you an idea why?
> How i can catch the exception of the expiration session?
>
> Thanks in advance
>
> Sylvain
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Exception-when-Session-expired-tp4649854.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com