this guideの後に、struts2 jasper reports pluginを使用してPDFをコンパイルして作成するが、WEB_APP/report.jrxmlとは別のパスからreport.jrxml
をロードする必要がある。Struts2 + jasperプラグイン、ロケーションベースパスを変更する
<action name="jasper" class="web.app.controller.JasperAction">
<result name="success" type="jasper">
<param name="location">${location}</param>
<param name="dataSource">map</param>
<param name="format">PDF</param>
</result>
</action>
${location} == /my/absolute/path
:
これは私の行動の結果です。
ofcourseの私は、このエラーが表示されます。
javax.servlet.ServletException: java.io.FileNotFoundException: WEB_APP/my/absolute/path/report.jasper
は、どのように私は、 "基本パス" を変更できますか?この依存関係をよりうまく構成する必要がありますか?
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>${jasperreports.version}</version>
<type>jar</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
</exclusions>
</dependency>