I used below strategy for error manager:
All actions can throw exception.There is a Error Manager Interceptor which
catch all exceptions and convert them to a json message and return it.
try { return invocation.invoke(); } catch (Exception ex) {
//Make some json result
response.getWriter().write(String.format("{ \"%s\":\"%s\"}",
DEFAULT_GLOBAL_ERROR_KEY, ex));
return Action.NONE; }
This was working in Struts 2.3.16.
After switching to 2.3.20 this is not working. When an action throws an
exception, I got below warning
DEBUG accessor.XWorkMethodAccessor Error calling method through OGNL: object:
[foo.LoginProcess@61d18d46] method: [result] args: [[]]
I think it is because OGNL is used to call action's methods. ~Regards,
~~Alireza Fattahi