Struts2 organization ----- Exception Handling and struts2 organization -----
There is no result type defined for type 'chart' mapped with name 'success'
When struts2 is integrated with JFreeChart for use, directly configure the following action
<! -- Chart output action --> <action name = "ChartOutputAction" class = "chartOutputAction"> <result name = "success" type = "chart"> <param name = "height"> 300 </param> <param name = "width"> 400 </param> </result> </action>
This exception occurs:
Caused by: There is no result type defined for type 'chart' mapped with name 'success'. Did you mean 'chart'? - result - file:/D:/apache-tomcat-7.0.35/webapps/DAQ/WEB-INF/classes/struts.xml:114:40 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:721) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:435) ... 21 more
Solution:
In struts2's default struts-default.xml, there is no result-type containing the chart, which is used in the form of a plug-in.
PS: About result-type details http://blog.csdn.net/liyunyun6/article/details/9730505
Import the struts2-jfreechart-plugin-2.3.15.1.jar in the project, and add a chart result-type in struts. xml.
<Result-types> <result-type name = "chart" class = "org. apache. struts2.dispatcher. ChartResult"/> </result-types> <! -- Chart output action --> <action name = "ChartOutputAction" class = "chartOutputAction"> <result name = "success" type = "chart"> <param name = "height"> 300 </param> <param name = "width"> 400 </param> </result> </action>