我正在使用下面的代码来获取 xls 中的输出。
else if ("xls".equalsIgnoreCase(reporttype)) {
try
{
System.out.println("inside xls1");
response.setContentType("application/vnd.ms-excel");
System.out.println("inside xls2");
response.setHeader("Content-Disposition", "inline; filename=\""
+ strId + ".xls\"");
System.out.println("inside xls3");
exporter = new JRXlsExporter();
System.out.println("inside xls4");
exporter.setParameter(JRExporterParameter.JASPER_PRINT,
jasperPrint);
System.out.println("inside xls5");
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,
ouputStream);
System.out.println("inside xls6");
System.out.println("inside exporter for XLS: "+exporter);
}
catch(Exception e)
{
System.out.println("inside xls catch");
e.printStackTrace();
}
}
但它发生在错误之下。
Struts 问题报告 Struts 检测到一个未处理的异常:消息:没有为操作 com.coin.fk.SalesAction 定义结果和结果异常
文件:file:/D:/blm/.metadata/.plugins/org.eclipse.wst.server .core/tmp0/wtpwebapps/blm/WEB-INF/classes/struts.transaction.xml
行号:44 列号:77
<action name="salesAction_*" method="{1}" class="com.coin.fk.SalesAction">
<interceptor-ref name="defaultLoginStack"/>
<interceptor-ref name="defaultStack">
堆栈跟踪
没有为操作 com.coin.fk.SalesAction 和结果异常定义结果 - 操作 - 文件:/D:/blm/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/blm/WEB- INF/classes/struts.transaction.xml:44:77
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:350)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
org.apache.struts2 .impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
org .apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor. java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang。 Thread.run(未知来源)您看到此页面是因为启用了开发模式。开发模式或 devMode 启用额外的调试行为和报告以帮助开发人员。要禁用此模式, 请在 WEB-INF/classes/struts.properties 文件中 设置:
struts.devMode=false 。
我该如何面对这个问题。请帮助如何调试此错误。