jfreechart 在jsp页面显示不了!!急急~~求帮助
下面是异常信息:
ERROR - Could not find action or result
/MyFirstSSH/servlet/DisplayChart?filename=jfreechart-4058960191575928594.png
There is no Action mapped for action name DisplayChart. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
web.xml配置:
<servlet>
<servlet-name> DisplayChart </servlet-name>
<servlet-class> org.jfree.chart.servlet.DisplayChart </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> DisplayChart </servlet-name>
<url-pattern> /servlet/DisplayChart </url-pattern>
</servlet-mapping>
action调用方法生成 graphURL 传递到jsp中:
public String getPicture() throws
IOException {
HttpSession session = ServletActionContext.getRequest().getSession();
AVote vote = new AVote();
vote.setPictype( "pie ");
vote.setTitle( "您最喜欢的电影? ");
String filename = Tryitshow.generatePieChart(iVoteService.getVoteResult_Ser(1), vote, session);
graphURL = ServletActionContext.getRequest().getContextPath()+
"/servlet/DisplayChart?filename= " + filename;
return "doVoteQuery ";
}
jsp中这样引用的:
<img src= ' <s:property value= "graphURL "/> ' width=500 height=300 border=0>
整了一天各种方法都试过了。。就是没用。。急求各位帮助~谢啦
------解决方案--------------------
原来如此~