To trigger the error handler for dojo’s xhrPost, is there a specific format in which the server response is to be sent? Or just setting the status code to the required error code in the HttpServletResponse object does the work.
Thanks,
RR
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You only need to set the appropiate HTTP status code in the
HttpServletResponse. I think anything greater than or equal to 400 will be considered an error by the XHR object.Of course you can also send actual content in your response (via its output stream) and set its content type. You’ll receive that in your handler as well:
You can also get
responseTextandstatusfromioargs.xhr, which is the fullXmlHttpRequestobject.