Thanks, Peter.  I do know about request.isXHR(), but it's actually more 
important to me to know whether the request is an event request (as opposed to 
a page request) than if it's an Ajax request.  Also, can a service inject the 
request object?


Franz



________________________________
From: Peter Stavrinides (via Nabble) <[EMAIL PROTECTED]>
To: Franz Amador <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2008 12:57:15 AM
Subject: Re: How can my RequestExceptionHandler distinguish event requests from 
page requests?

You can use: request.isXHR() which checks against a header "X-Requested-With" 
set by the prototype library for AJAX calls. If you write your own AJAX stuff 
then request.isXHR() probably won't be set so you will have to set it yourself. 

Cheers 
Peter 


-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail. 

----- Original Message ----- 
From: "Franz Amador" <[EMAIL PROTECTED]> 
To: [EMAIL PROTECTED] 
Sent: Tuesday, 9 December, 2008 9:10:14 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul 
Subject: How can my RequestExceptionHandler distinguish event requests from 
page requests? 


My app responds to Ajax event requests with JSON.  If the event handler 
throws an exception, I'd like to return a special JSON response with the 
error text.  Can I decorate RequestExceptionHandler for this?  To do so, I'd 
need to be able to tell that the request is an Ajax event request; if it 
isn't, I'll delegate to the default RequestExceptionHandler.  Is there a 
service I can use in my RequestExceptionHandler that'll tell me whether the 
request is an event request and not, say, a page request? 
-- 
View this message in context: 
http://n2.nabble.com/How-can-my-RequestExceptionHandler-distinguish-event-requests-from-page-requests--tp1635333p1635333.html
Sent from the Tapestry Users 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] 



________________________________
 
This email is a reply to your post @ 
http://n2.nabble.com/How-can-my-RequestExceptionHandler-distinguish-event-requests-from-page-requests--tp1635333p1637872.html
You can reply by email or by visting the link above.
-- 
View this message in context: 
http://n2.nabble.com/How-can-my-RequestExceptionHandler-distinguish-event-requests-from-page-requests--tp1635333p1639644.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

Reply via email to