I am using Struts 2 in my web application. I write code to check user session into interceptor but while I am returning net.sf.json.JSONObject
as response, its
There are mutliple errors in your code.
Use statusCode to set the status of the response:
<result name="error" type="json">
<param name="statusCode">304</param>
</result>
And errorCode to send an error(the server might end up sending something to the client which is not the serialized JSON):
<result name="error" type="json">
<param name="errorCode">404</param>
</result>
and then read it client-side in the AJAX callback function.