Struts2 organization ----- Exception Handling and struts2 organization -----

Source: Internet
Author: User

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>

 

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.