The Exceptionmappinginterceptor interceptor in Xwork closes the exception print by default, which is to jump to the exception-handling page by default.
We need to open it at development time, change the parameters configured in struts as follows, and add the following code to the action configuration:
<action name= "*!*" class= "{1}action" method= "{2}" >
<interceptor-ref name= "Defaultstack" >
<param name= "exception.logenabled" >true</param>
<param name= "Exception.loglevel" >error</param>
</interceptor-ref>
</action>
Java code logenabled (optional)-Should exceptions also be logged? (Boolean true|false) loglevel (optional)-What log level should we use (Trace, debug, info, warn, error, fatal)? -Defaut is debug logcategory (optional)-If provided we would use this category (eg. com.mycompany.app). The Default is to use Com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.
Logenabled Configure whether log output is turned on
The loglevel configuration blocks to the log level of the exception.
Logcategory should be a custom log.
Reprint Address: http://blog.sina.com.cn/s/blog_70e85d6c0100x89r.html