iReport4.5.1、Struts2.2.3生成Html文档时页面红叉叉的解决办法。

iReport4.5.1、Struts2.2.3生成Html文档时页面红叉叉的解决办法。

 

 

这些个小红叉叉甚的恼人!

解决方法如下:

而且后台报错:

提示找不到名字为px的action

  
  
  
  
  1. 警告: Could not find action or result  
  2. There is no Action mapped for namespace /images and action name px. - [unknown location]  
  3.     at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)  
  4.     at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)  
  5.     at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)  
  6.     at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)  
  7.     at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)  
  8.     at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)  
  9.     at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)  
  10.     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  
  11.     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
  12.     at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)  
  13.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)  
  14.     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  
  15.     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
  16.     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
  17.     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
  18.     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
  19.     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
  20.     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
  21.     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)  
  22.     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)  
  23.     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)  
  24.     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  
  25.     at java.lang.Thread.run(Thread.java:619) 

具体的请查看源码:

struts2-jasperreports-plugin-2.2.3.jar

下面 JasperReportsResult.class文件

①提取px.gif图片

在jasperreports-4.5.1.jar中查找

具体路径如下:

jasperreports-4.5.1\net\sf\jasperreports\engine\images\pixel.GIF

重命名为px.gif放在项目的images文件夹下面。

②修改Struts2配置文件:

  
  
  
  
  1. <package name="px" namespace="/images" extends="struts-default">   
  2.          <action name="px">   
  3.                  <result>/images/px.gif</result>   
  4.    </action>   
  5. </package>  

 

你可能感兴趣的:(html,struts,IREPORT,红叉叉)