• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handling Session timeout with ajax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling Session timeout with ajax


  • Subject: Re: Handling Session timeout with ajax
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 27 Jan 2009 21:35:33 -0800


On Jan 27, 2009, at 8:38 PM, Paul Hoadley wrote:

On 28/01/2009, at 1:40 PM, Chuck Hill wrote:

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?

I'm not using ERXRedirect directly, but in Application.handleException() I have this:


@Override
public WOResponse handleException(Exception anException, WOContext aContext) {
AMErrorPage errorPage = (AMErrorPage) pageWithName(AMErrorPage.class
.getName(), aContext);
errorPage.setPageType(AMErrorPage.EXCEPTION);
if (AjaxUtils.isAjaxRequest(aContext.request())) {
AjaxUtils.redirectTo(errorPage);
return errorPage.context().response();

I suspect that this return is not what is wanted. Removing it does not fix the problem.



		}
		return errorPage.generateResponse();
	}

(Just some logging statements removed.)


Are you by chance terminating the session? I was and that rather prevents the page from being restored. Now that I don't terminate it, I get a page restoration. I use AjaxUtils.redirectTo(page); successfully in other places, so I am guessing that somehow in the error handling the errorPage is not getting cached correctly.

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
  • Follow-Ups:
    • Re: Handling Session timeout with ajax
      • From: Paul Hoadley <email@hidden>
References: 
 >Handling Session timeout with ajax (From: Amedeo Mantica <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: Handling Session timeout with ajax
  • Next by Date: Re: Handling Session timeout with ajax
  • Previous by thread: Re: Handling Session timeout with ajax
  • Next by thread: Re: Handling Session timeout with ajax
  • Index(es):
    • Date
    • Thread