That's not how I want it.
I have a custom PageExpiredErrorPage (and AccessDenied...), so he has to
take those automaticly.
getApplicationSettings().setPageExpiredErrorPage(CustomPageExpiredErrorPage.class);
With your solution I have to repeat them everywhere, like I do now with
setResponsePage().
Serkan Camurcuoglu-3 wrote:
>
> If all you want is to display a page expired page, maybe you could just
> use
>
> throw new RestartResponseException(PageExpiredErrorPage.class);
>
> in your page constructor.
>
>
>
> Ann Baert wrote:
>> Can anyone help me with this problem please?
>> Thanks in advance, Ann.
>>
>>
>>
>> Ann Baert wrote:
>>
>>> I have overridden the RequestCycle.onRuntimeException method:
>>>
>>> @Override
>>> public RequestCycle newRequestCycle(final Request request, final
>>> Response
>>> response) {
>>> return new WebRequestCycle(this, (WebRequest) request, (WebResponse)
>>> response) {
>>>
>>> @Override
>>> public Page onRuntimeException(Page page, RuntimeException e) {
>>> Throwable t = e.getCause();
>>> while(t != null) {
>>> if(t instanceof PageExpiredException) {
>>> return super.onRuntimeException(page, new
>>> PageExpiredException("test"));
>>> }
>>>
>>> t = t.getCause();
>>> }
>>> return super.onRuntimeException(page, e);
>>> }
>>> };
>>> }
>>>
>>> He comes in the if(t instanceof PageExpiredException)..., but in the
>>> AbstractRequestCycleProcessor.respond(RuntimeException e, RequestCycle
>>> requestCycle) method he doesn't do anything with the RuntimeException.
>>> So
>>> he has still a WicketRuntimeException instead of the
>>> PageExpiredException.
>>>
>>> Ann
>>>
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>
>>>> you can try unwrapping the exceptions in
>>>> requestcycle.onruntimeexception and call super with the page exipred
>>>> exception.
>>>>
>>>> -igor
>>>>
>>>> On Fri, Jul 10, 2009 at 3:00 AM, Ann Baert<[email protected]> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> How can I throw a PageExpiredException in the constructor of my
>>>>> WebPage?
>>>>> Because the exception is wrapped by Wicket with WicketRuntimeException
>>>>> it
>>>>> goes to the InternalErrorPage.
>>>>>
>>>>> Thanks,
>>>>> Ann
>>>>> **** DISCLAIMER ****
>>>>> http://www.tvh.be/newen/pages/emaildisclaimer.html
>>>>> http://www.tvh.be/newen/pages/emaildisclaimer.html
>>>>>
>>>>> "This message is delivered to all addressees subject to the conditions
>>>>> set forth in the attached disclaimer, which is an integral part of
>>>>> this
>>>>> message."
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/How-to-throw-new-PageExpiredException--tp24424791p24512739.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]