Configuring RunTimeException class in Struts2 -


My requirement is as follows: My app is built on the Strauss 2 framework and is using the annotation plugin. When I get any runtime exception , then I need to call a method of my custom class which is the error stack print using the e.printStackTrace () method Does. How can I configure this class in my application? I do not want to use the block and use the capture in each and every action.

After getting the error, I want to show the user error.jsp . But I would like to print error stack in my bot console. Please tell me that anyone is considering.

Thanks Peter

I'm not sure about annotations since I have used this very limited experiment but it is ExceptionMappingInterceptor . With the help of

the struts.exml file can be easily used. You just need to define custom stack and to add some parameters to the XML file, S2 to handle any exceptions and log file / console

 at the same time log in < Code> & lt; Interceptors & gt; & Lt; Interceptor-Stack name = "App default stack" & gt; & Lt; Interceptor-Rif name = "Default stock" & gt; & Lt; Param name = "exception.log enabled" & gt; True & lt; / Param & gt; & Lt; Param name = "exception.logLevel" & gt; Error & lt; / Param & gt; & Lt; / Interceptor-referee & gt; & Lt; / Interceptor-pile & gt; & Lt; / Interceptor & gt; & Lt; Default-interceptor-rif name = "app default stock" / & gt;   

For more information, see I believe it can easily be converted to annotation based solution because the annotation plugin provides all the options in the XML option.

Comments