【问题标题】:Dynamic-Jasper Struts2 Netbean configurationDynamic-Jasper Struts2 Netbean 配置
【发布时间】:2023-03-10 05:01:02
【问题描述】:

我正在将dynamicjasper 配置为我的struts2,但它会引发错误。首先,我使用以下 jar 文件:

DynamicJasper-4.0.3
DynamicJasper-4.0.3-javadoc
DynamicJasper-4.0.3-sources
DynamicJasper-4.0.3-tests
DynamicJasper-4.0.3-test-sources
DynamicJasper-Struts2-1.3
jasperreports-4.7.0
struts2-jasperreports-plugin-2.0.11.1-sources

<result-types> 
     <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
     <result-type name="redirectAction" 
class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
     <result-type name="dynamic-jasper" class="ar.com.fdvs.dj.struts2.DJStruts2Result"/>
</result-types>

<action name="dynamicreport" class="ActionClass.DynamicJasperAction">
            <interceptor-ref name="defaultLoginStack"/>
            <param name="operation">showreport</param>
            <result name="SUCCESS" type="dynamic-jasper">
                 <param name="format">PDF</param>
            </result>
</action>

当我运行应用程序时,它会在 glass fish 3+ 输出窗口中显示以下错误:

INFO: ERROR  (org.apache.struts2.dispatcher.Dispatcher:38) - Dispatcher initialization failed
Unable to load configuration. - action - file:/G:/Project/IG/LIMSs/build/web/WEB-INF/classes/struts.xml:2996:78

Caused by: There is no result type defined for type 'dynamic-jasper' mapped with name 'SUCCESS'.  Did you mean 'dynamicJasper'? - result - file:/G:/Project/IG/LIMSs/build/web/WEB-INF/classes/struts.xml:2999:58
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:645)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:379)
    ... 57 more

INFO: WEB0671: Loading application [IMsys] at [/LIMSs]
INFO: IMsys was successfully deployed in 71,796 milliseconds.
WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

浏览器报错如下:

exception
org.apache.jasper.JasperException: The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
root cause
The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

我不知道如何配置动态jasper,你能建议吗?

【问题讨论】:

  • Did you mean 'dynamicJasper'?.

标签: struts2 dynamic-jasper


【解决方案1】:

只需下载DynamicJasper-4.0.3-test-sources.jar而不是DynamicJasper-4.0.3-test.jar然后添加问题就解决了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-23
    • 1970-01-01
    相关资源
    最近更新 更多