Re: Handling Session timeout with ajax
Re: Handling Session timeout with ajax
- Subject: Re: Handling Session timeout with ajax
- From: Chuck Hill <email@hidden>
- Date: Tue, 27 Jan 2009 19:10:44 -0800
On Jan 27, 2009, at 6:59 PM, Paul Hoadley wrote:
On 28/01/2009, at 10:59 AM, Chuck Hill wrote:
On Jan 27, 2009, at 4:18 PM, Paul Hoadley wrote:
On 28/01/2009, at 10:08 AM, Chuck Hill wrote:
On Jan 26, 2009, at 11:17 PM, Paul Hoadley wrote:
On 27/01/2009, at 5:11 PM, Chuck Hill wrote:
FireBug and FireFox. Take a look at the Net log. You can see
all the traffic back and forth. Often these things came in an
Ajax update and so don't show up in the page source (as
originally loaded). Look at the response content in FireBug
and you should be able to find it.
Sorry Chuck, I'm obviously having a slow afternoon (and it's
41ºC here)
It is snowing here. I am willing to trade.
Did not even consider that, did you?
Actually, I did. It's 42ºC today, 39ºC tomorrow. Please send snow.
It is on the way.
---I assume you mean to look using the Net log on the page where
I'm generating the Exception, but _after_ the exception has been
thrown, right? I don't get the chance, as the app responds to
the request, returning the login page, and the inspector is
updated. Am I looking in the right place?
Yes, almost. What I would do is go to this before you trigger
the exception and hit Clear. Then trigger the exception, and see
what show up.
When I trigger the exception (by using an AjaxUpdateLink, and I
suspect this is the problem), I assume the errant request is
coming from some JS executed due to the onclick attribute. In
which case, I can't seem to catch it with Firebug. I trigger the
exception, and the next thing that happens is I'm back at Main.
By then it's too late, all Firebug shows is the errant request
itself, and the rest of the requests/responses to render Main.
Can you not scroll back up? I thought it kept quite a record of
the RR loops.
Maybe I have FireBug configured wrong, but I can't seem to scroll
back.
If not, follow Anjo's suggestion of overriding dispatchRequest()
and logging out the response before returning it.
Jan 28 13:23:08 AM[50121] WARN NSLog -
<er.ajax.AjaxRequestHandler>: Exception occurred while handling
request:
java.lang.NullPointerException
Jan 28 13:23:08 AM[50121] INFO NSLog -
Application.handleException: Handling an Exception:
[2009-1-28 13:23:8 CST] <WorkerThread1> java.lang.NullPointerException
...
Jan 28 13:23:08 AM[50121] INFO NSLog - AMErrorPage.setPageType:
pageType = exception
Application.dispatchRequest:
<script type="text/javascript">document.location.href='/cgi-bin/
WebObjects/AM.woa/wo/4.0';</script>
Application.dispatchRequest:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
">
...
So there's the request, coming from a small Javascript fragment. I
don't know what's generating _that_, though.
That looks like what ERXRedirect can return:
if (ERXAjaxApplication.isAjaxRequest(context.request())) {
boolean hasUpdateContainer =
context
.request
().stringFormValueForKey(ERXAjaxApplication.KEY_UPDATE_CONTAINER_ID) !
= null;
if (hasUpdateContainer) {
response.appendContentString("<script type=\"text/javascript\">");
}
else {
response.setHeader("text/javascript", "Content-Type");
}
response.appendContentString("document.location.href='" + url +
"';");
if (hasUpdateContainer) {
response.appendContentString("</script>");
}
How are you using that ERXRedirect again?
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden