About STRUTS2 exception or error not output to console reason

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.