the implementation of js failure handler does not work for the case
(from tracing the js codes)
i guess it is because the "ajax session expire exception" thrown to the
client contains "redirect" path information, by which wicket just use this
redirect path and ignore the failure handler
and i have come up a quick solution:
override the method WebRequestCycleProcessor (i.e. need to register your
custom processor)
<code>
public IRequestTarget resolve(RequestCycle requestCycle,
RequestParameters requestParameters) {
try {
return super.resolve(requestCycle, requestParameters);
} catch (RuntimeException re) {
if (re instanceof PageExpiredException) {
if (((WebRequestCycle)
requestCycle).getWebRequest().isAjax()) {
// return a custom ajax request that only contains
failure handle js
/*
AjaxRequestTarget art = new AjaxRequestTarget(null);
art.appendJavascript(your failure handler js);
return art;
*/
}
}
throw re;
}
}
</code>
Markus Strickler wrote:
>
> Hi-
>
> not sure if this helps in your case, but if you define the
> wicketGlobalFailureHandler() JavaScript function, it will be called
> if your ajax request fails (because of page expiration or any other
> reason).
> Or use Wicket.Ajax.registerFailureHandler(function() { ...}) (but I
> never tried that myself).
>
> -markus
>
> Am 17.04.2008 um 13:01 schrieb ywtsang:
>>
>> we want to handle session expiration exception triggered by an ajax
>> request
>>
>> since the session is expired, the ajax request can't be forwarded
>> to the
>> corresponding ajax behavior, instead, the server throw session
>> expiration
>> exception
>> (we have configured the handling by
>> getApplicationSettings().setPageExpiredErrorPage)
>>
>> the handling is ok for non-ajax request, but not ajax request
>>
>> we want to handle that using client side javascript
>>
>> how can we achieve that?
>>
>> --
>> View this message in context: http://www.nabble.com/client-side-
>> handling-of-ajax-request-session-expiration-tp16743324p16743324.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]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/client-side-handling-of-ajax-request-session-expiration-tp16743324p16824188.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]