首先,我去了这里(http://code.google.com/p/struts2-examples/downloads/list并下载了 Hello_World_Struts2_Mvn.zip)并运行了该示例。
之后,我去了这里(http://struts.apache.org/2.x/docs/jfreechart-plugin.html),我添加了 commons-lang-2.5.jar,jcommon-1.0.16.jar的依赖项和jfreechart-1.0.13.jar我修改了从 code.google.com 下载的示例以查看JFreeChart是如何工作的,但我收到此错误:
Unable to load configuration. - action - file:/C:/.../untitled_war_exploded/WEB-INF/classes/struts.xml:34:67
Caused by: Error building results for action createChart in namespace - action - file:/C:/.../out/artifacts/untitled_war_exploded/WEB-INF/classes/struts.xml:34:67
Caused by: There is no result type defined for type 'chart' mapped with name 'success'. Did you mean 'chart'? - result - file:/C:/.../out/artifacts/untitled_war_exploded/WEB-INF/classes/struts.xml:36:49
struts.xml 的第 36 行是这段代码(来自 struts2 网站的代码):
<action name="viewModerationChart" class="myapp.actions.ViewModerationChartAction">
<result name="success" type="chart">
<param name="width">400</param>
<param name="height">300</param>
</result>
</action>
我做错了什么?