`
jeasony
  • 浏览: 200024 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

struts2整合jasperreport学习笔记

阅读更多

关键字: struts2

除了struts2必备的jar包外还需导入下面的包:
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-digester-1.7.jar
commons-el-1.0.jar
commons-lang-2.1.jar
itext-1.4.1.jar
iTextAsian.jar
struts2-jasperreports-plugin-2.0.11.1.jar
jasperreports-3.0.0.jar

第一步是设计报表文件:用的工具是ireport,可以进行可视化设计,设计好后,保存为jrxml或xml后缀后文件以备后用。

第二步编写Action类:
  1. import java.io.File;   
  2. import java.util.List;   
  3.   
  4. import net.sf.jasperreports.engine.JasperCompileManager;   
  5.   
  6. import org.apache.struts2.ServletActionContext;   
  7.   
  8. import com.gfs.daoAction.DaoAction;   
  9. import com.opensymphony.xwork2.ActionContext;   
  10. import com.opensymphony.xwork2.ActionSupport;   
  11.   
  12. @SuppressWarnings("serial")   
  13. public class ShowReport extends ActionSupport {   
  14.   
  15.     @SuppressWarnings("unchecked")   
  16.     @Override  
  17.     public String execute() throws Exception {   
  18.         DaoAction dao = new DaoAction();   
  19.         reportlist = dao.queryAll();   
  20.         try {   
  21.             String reportSource;   
  22.             reportSource = ServletActionContext.getServletContext()   
  23.                     .getRealPath("/report/MyFirstReport.jrxml");   
  24.             File parent = new File(reportSource).getParentFile();   
  25.             JasperCompileManager.compileReportToFile(reportSource, new File(   
  26.                     parent, "MyFirstReport.jasper")   
  27.                     .getAbsolutePath());   
  28.         } catch (Exception e) {   
  29.             e.printStackTrace();   
  30.             return ERROR;   
  31.         }   
  32.         return SUCCESS;   
  33.     }   
  34.   
  35.     public List getReportlist() {   
  36.         return reportlist;   
  37.     }   
  38.   
  39. }  
import java.io.File;
import java.util.List;

import net.sf.jasperreports.engine.JasperCompileManager;

import org.apache.struts2.ServletActionContext;

import com.gfs.daoAction.DaoAction;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class ShowReport extends ActionSupport {

	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		DaoAction dao = new DaoAction();
		reportlist = dao.queryAll();
		try {
			String reportSource;
			reportSource = ServletActionContext.getServletContext()
					.getRealPath("/report/MyFirstReport.jrxml");
			File parent = new File(reportSource).getParentFile();
			JasperCompileManager.compileReportToFile(reportSource, new File(
					parent, "MyFirstReport.jasper")
					.getAbsolutePath());
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
		return SUCCESS;
	}

	public List getReportlist() {
		return reportlist;
	}

}


第三步在WebRoot目录下建立文件夹report,将设计好的报表xml文件(MyFirstReport.jrxml)放到此目录下,在WebRoot目录下再建一个目录images,将jasperreport-3.0.0.jar包下jasperreports-3.0.0\net\sf\jasperreports\engine\images\pixel.gif文件复制到images目录下,并改名为px即可。

第四步配置struts.xml:
Xml代码 复制代码
  1. <package name="report" extends="struts-default,jasperreports-default">  
  2.         <action name="showReport" class="com.gfs.action.ShowReport">  
  3.             <result name="success" type="jasper">  
  4.                 <param name="location">  
  5.                     /report/MyFirstReport.jasper   
  6.                 </param>  
  7.                 <param name="dataSource">reportlist</param>  
  8.             </result>  
  9.         </action>  
  10.     </package>  
<package name="report" extends="struts-default,jasperreports-default">
		<action name="showReport" class="com.gfs.action.ShowReport">
			<result name="success" type="jasper">
				<param name="location">
					/report/MyFirstReport.jasper
				</param>
				<param name="dataSource">reportlist</param>
			</result>
		</action>
	</package>


第五步编写JSP页面:
Html代码 复制代码
  1. <body>  
  2.     <s:url action="showReport" id="action" />  
  3.     <a href="<s:property value='action'/>">显示报表</a>  
  4. </body>  
	<body>
		<s:url action="showReport" id="action" />
		<a href="<s:property value='action'/>">显示报表</a>
	</body>

分享到:
评论
1 楼 hm2008 2010-10-29  
你好!我按照你的步骤做了,出现一下异常
[ ERROR 2010-10-29 13:00:47 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/customer-portal-portlet].[customerPortlet] - 711 - invoke ] : Servlet.service() for servlet customerPortlet threw exception
java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/Object;)Ljava/lang/Object;
at org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:199)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:451)
at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:322)
at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:126)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:100)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:618)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:700)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:419)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1462)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:2884)
at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:897)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:170)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:103)
at com.liferay.portlet.layoutconfiguration.util.velocity.PortletColumnLogic.processContent(PortletColumnLogic.java:133)
at com.liferay.portlet.layoutconfiguration.util.velocity.TemplateProcessor.processColumn(TemplateProcessor.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
at com.liferay.portal.velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:179)
at com.liferay.portal.kernel.velocity.VelocityEngineUtil.mergeTemplate(VelocityEngineUtil.java:84)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:237)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:190)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:824)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:294)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:471)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:195)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:157)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:608)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:142)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:140)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:425)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:257)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter.processFilter(OpenSSOFilter.java:73)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:193)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.threadlocalcache.ThreadLocalCacheFilter.processFilter(ThreadLocalCacheFilter.java:55)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)
13:00:47,849 ERROR [jsp:165] java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/Object;)Ljava/lang/Object;
at org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:199)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)

请问你你能看出来具体的问题吗?可以给我你的源码查考下吗?

相关推荐

    struts2整合jasperreport

    在本文中,我们将深入探讨如何整合Struts2框架与JasperReport3来创建动态报表,并利用iReport工具进行报表设计。Struts2是一个流行的Java Web应用程序框架,它提供了MVC(模型-视图-控制器)架构,而JasperReport则...

    Struts2整合JasperReport所需要的jar包

    在整合Struts2和JasperReport时,我们需要一些特定的jar包来确保两者能正确通信和协同工作。这些jar包通常包含了Struts2的核心组件、JasperReport库以及它们的依赖。下面,我们将详细讨论整合过程中可能用到的关键...

    Struts2+JasperReport报表应用

    Struts2和JasperReport的整合是Web应用程序中创建动态报表的一种常见方法。JasperReport是一个功能强大的开源报表引擎,允许开发人员通过iReports这样的设计工具以可视化的形式创建复杂的报表模板。Struts2,作为一...

    整合Struts2.1+jasperreport

    Struts2.1和JasperReport的整合是Java Web开发中的一个重要话题,它涉及到Web应用程序的MVC(模型-视图-控制器)架构和数据报告的生成。Struts2.1是一个强大的MVC框架,而JasperReport则是一个用于创建复杂报表的...

    Struts2_JasperReport整合的例子

    首先,Struts2和JasperReport整合的基础是理解这两个框架的核心概念。Struts2提供了一种规范化的请求处理机制,通过Action类和配置文件控制请求流程。JasperReport则依赖于IReport设计工具,允许开发者通过图形化...

    ssh三大框架简单整合,struts2整合JasperReport报表,图表

    ssh三大框架简单整合,struts2整合JasperReport报表,解决HTML显示图片不出来,PDF中文不显示的问题 网上找答案,乱七八糟的!我研究了几天,终于彻底搞明白了!代码里有些注释,有凝问的可以留言。。。。。。 ...

    Struts2与Jasperreport报表结合

    Struts2和JasperReport是两个在Java Web开发中广泛使用的框架。Struts2作为MVC(模型-视图-控制器)架构的一部分,主要用于处理HTTP请求并管理应用程序流程,而JasperReport则是一个强大的报告生成工具,能够创建...

    struts2+Ireport+Jasperreport实现报表导出

    Struts2、iReport与JasperReport是Java开发中用于构建高效、动态Web应用程序和报表生成的工具。在这个项目中,这些技术结合在一起,提供了一种强大的报表导出解决方案。以下是对这些关键技术及其在项目中的应用的...

    整合Struts2+JasperReport Web报表应用示例

    Struts2 和 JasperReport 的整合是为了解决在 Web 应用中生成复杂报表的需求。JasperReport 是一个强大的开源报表引擎,它允许开发者通过设计模板来生成各种类型的报表,如 PDF、HTML、Excel 等。而 Struts2 是一个...

    Struts2 + JasperReport应用一:导PDF,Excel,HTML显示

    在将Struts2与JasperReport整合时,首先需要在Struts2项目中添加JasperReport的依赖库,这通常包括jasperreports、jcommon、jfreechart等。接下来,我们需要创建一个Action类,该类将负责处理报表生成的请求,并调用...

    Struts2与jasperReport简单示例

    4. **整合Struts2**:创建一个Struts2 Action,这个Action负责生成报表。在Action中调用上述步骤生成报表实例,然后将其设置为Action的一个属性,以便传递到视图。 5. **配置结果类型**:在struts.xml中,为这个...

    struts2-jasperreport-plugin-2.1.6.1

    官方发布的 struts2-jasperreport-plugin-2.1.6存在以下问题: 1、普通报表HTML、Excel格式浏览存在px图片无法显示; 2、解决问题:图形报表一次请求返回多张时存在报表覆盖异常现象; 3、支持数据源单一(改造后支持...

    struts2+jasperReport+ireport做报表总结

    Struts2、JasperReport 和 iReport 是开发Web报表应用中的常用技术栈。本文主要针对使用Struts2框架结合JasperReport5.0与iReport5.0进行报表开发时可能遇到的问题进行总结。 1. **报表预览问题**: - 数据源为空...

    maven struts2 jasperreport ireport亲测通过整合多家资源

    在这个场景下,`Maven`、`Struts2`、`JasperReport` 和 `iReport` 是四个关键的技术组件,它们共同作用于创建一个强大的、数据驱动的Web应用程序。下面将详细介绍这些技术及其整合过程。 首先,`Maven` 是一个项目...

    Struts2集成jasperreport3.7.1所需的Jar包

    Struts2是一个流行的Java Web应用程序框架,用于构建...总的来说,这些库文件构成了Struts2集成JasperReport的基础,使得开发者可以在Web应用中轻松地创建和展现丰富的报表,同时利用Struts2的强大功能进行交互和控制。

    struts2利用jasperreport导出excel

    在这个主题中,我们将深入探讨如何在Struts2中集成JasperReport来导出Excel。 首先,我们需要理解Struts2的工作原理。Struts2框架基于拦截器模型,通过Action类处理用户请求,并返回结果到视图层。为了实现导出...

    struts2 jasperreport

    struts2 jasperreport

Global site tag (gtag.js) - Google Analytics