こんにちは、jfreechart を struts 2 A に統合しようとしていますが、多くのエラー メッセージが表示されます
これは私のストラットです
<package name="jfreechart" namespace="/" extends="jfreechart-default">
<default-action-ref name="repporting" />
<action name="repporting">
<result>/web/userinterne/repporting.jsp</result>
</action>
<action name="Graphique" method="{1}" class="calendar.action.JfreeChartAction">
<result name="success" type="chart">
<param name="value">chart</param>
<param name="type">png</param>
<param name="width">600</param>
<param name="height">400</param>
</result>
</action>
</package>
そしてこれが私の行動です
package calendar.action;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot3D;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.util.Rotation;
import com.opensymphony.xwork2.ActionSupport;
public class JfreeChartAction extends ActionSupport {
private JFreeChart chart;
public String execute() throws Exception {
DefaultPieDataset donnees=new DefaultPieDataset();
donnees.setValue("Code",05);
donnees.setValue("Développement",02);
donnees.setValue("Tests",06);
donnees.setValue("Maintenance",01);
chart = ChartFactory.createPieChart3D(
"Répartition du typologiecarte", //titre
donnees, // données à afficher
true, // afficher la légende
true,
true
);
// créer le camembert
PiePlot3D plot=(PiePlot3D) chart.getPlot();
// angle d’affichage
plot.setStartAngle(190);
// rotation
plot.setDirection(Rotation.CLOCKWISE);
// transparence du schéma
plot.setForegroundAlpha(0.4f);
plot.setNoDataMessage("Pas de données à afficher");
return SUCCESS;
}
// getter pour retourner l’image
public JFreeChart getChart() {
return chart;
}
}
これはjspです
<body>
<h3>Struts2-Jfreechart integration</h3>
<br />
<img src="Graphique"/>
</body>
プロジェクトを実行すると、このエラーが発生します
SEVERE: Exception au démarrage du filtre struts2
Error building results for action Graphique in namespace / - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/wtpwebapps/SMP/WEB-INF/classes/config/pl/jfreechart.xml:13:101
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:340)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: There is no result type defined for type 'chart' mapped with name 'success' - result - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/wtpwebapps/SMP/WEB-INF/classes/config/pl/jfreechart.xml:14:39
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:584)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:338)
... 27 more
解決方法がわかりません どなたか助けていただけないでしょうか?