没有为操作和结果异常定义结果

时间:2015-09-01 14:33:27

标签: java jboss struts2 jasper-reports jboss7.x

我正在编写一份报告,该报告在tomcat7,jboss7生产环境的开发环境中工作。

动作

<action name="reportFormData" class="cl.parvulo.util.reportFormData" method="testpdf">
     <result name="success" type="jasper">
        <param name="location">resources/formData.jasper</param>
        <param name="dataSource">beneficiary</param>
        <param name="reportParameters">parameters</param> 
        <param name="format">PDF</param>
    </result>
  </action> 

动作代码

    public class reportFormData extends BaseAction {
    public InputStream inputStream;
    private Map<String, String> parameters;
    private Integer anio;
    BeneficiaryVO beneficiary;

    public String testpdf() {
        try {
            this.getResponse().setHeader("Cache-Control", "cache");
            this.getResponse().setHeader("Pragma", "cache");
            beneficiary = new BeneficiaryVO();
            ParameterVO feriado1 = (ParameterVO) this.session.get("feriado1");
            ParameterVO feriado2 = (ParameterVO) this.session.get("feriado2");
            ParameterVO feriado3 = (ParameterVO) this.session.get("feriado3");
            ParameterVO feriado4 = (ParameterVO) this.session.get("feriado4");
            ParameterVO feriado5 = (ParameterVO) this.session.get("feriado5");
            ParameterVO feriado6 = (ParameterVO) this.session.get("feriado6");
            ParameterVO feriado7 = (ParameterVO) this.session.get("feriado7");
            ParameterVO feriado8 = (ParameterVO) this.session.get("feriado8");
            ParameterVO feriado9 = (ParameterVO) this.session.get("feriado9");
            ParameterVO feriado10 = (ParameterVO) this.session.get("feriado10");
            ParameterVO feriado11 = (ParameterVO) this.session.get("feriado11");
            ParameterVO feriado12 = (ParameterVO) this.session.get("feriado12");
            ParameterVO feriado13 = (ParameterVO) this.session.get("feriado13");
            ParameterVO feriado14 = (ParameterVO) this.session.get("feriado14");
            ParameterVO feriado15 = (ParameterVO) this.session.get("feriado15");

            this.parameters = new HashMap<String, String>();

            parameters.put("feriado1", feriado1.getGroupIdentifier());
            parameters.put("feriado2", feriado2.getGroupIdentifier());
            parameters.put("feriado3", feriado3.getGroupIdentifier());
            parameters.put("feriado4", feriado4.getGroupIdentifier());
            parameters.put("feriado5", feriado5.getGroupIdentifier());
            parameters.put("feriado6", feriado6.getGroupIdentifier());
            parameters.put("feriado7", feriado7.getGroupIdentifier());
            parameters.put("feriado8", feriado8.getGroupIdentifier());
            parameters.put("feriado9", feriado9.getGroupIdentifier());
            parameters.put("feriado10", feriado10.getGroupIdentifier());
            parameters.put("feriado11", feriado11.getGroupIdentifier());
            parameters.put("feriado12", feriado12.getGroupIdentifier());
            parameters.put("feriado13", feriado13.getGroupIdentifier());
            parameters.put("feriado14", feriado14.getGroupIdentifier());
            parameters.put("feriado15", feriado15.getGroupIdentifier());

            parameters.put("anio", anio.toString());

        } catch (Exception e) {
            e.printStackTrace();
        }
        return SUCCESS;
    }

    public InputStream getInputStream() {
        return inputStream;
    }

    public void setInputStream(InputStream inputStream) {
        this.inputStream = inputStream;
    }

    public Map<String, String> getParameters() {
        return parameters;
    }

    public void setParameters(Map<String, String> parameters) {
        this.parameters = parameters;
    }

    public Integer getAnio() {
        return anio;
    }

    public void setAnio(Integer anio) {
        this.anio = anio;
    }

    public BeneficiaryVO getBeneficiary() {
        return beneficiary;
    }

    public void setBeneficiary(BeneficiaryVO beneficiary) {
        this.beneficiary = beneficiary;
    }
}

此功能在tomcat7中完美运行,并正确显示pdf。 Jboss是问题所在,报告没有进入调试模式,只显示以下内容

10:44:13,310 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRBaseFiller  - Fill 1: created for formClear
10:44:13,321 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRFillBand  - Origin {reportName: null, groupName: null,bandType: DETAIL} for band 1352902772
10:44:13,322 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRVerticalFiller  - Filler 1 - pageHeight: 792, columnFooterOffsetY: 772, lastPageColumnFooterOffsetY: 772
10:44:13,322 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRBaseFiller  - Fill 1: filling report
10:44:13,323 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.util.DeduplicableRegistry  - Added object net.sf.jasperreports.engine.base.JRBaseStyle@77c22f8a
10:44:13,323 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRBaseFiller  - Fill 1: adding page 1
10:44:13,324 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.JRVerticalFiller  - Fill 1: detail at 20
10:44:13,622 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.util.DeduplicableRegistry  - Added object net.sf.jasperreports.engine.fill.JRTemplateImage@11ae80fa
10:44:13,624 INFO  [stdout] (http--0.0.0.0-8280-4) DEBUG 01-Sep-2015 10:44:13 net.sf.jasperreports.engine.fill.SimpleTextLineWrapper  - creating element font infos cache of size 2000

而不是显示pdf显示以下错误

  

HTTP状态404 - 没有为操作cl.sodexo.parvulo.util.reportFormClear和结果异常定义结果

0 个答案:

没有答案