[
https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46080#action_46080
]
Dave Newton commented on WW-3094:
---------------------------------
StringBuilder, getRealPath("/"), double-append will concatenate filenames for
path2. No reason to use a StringBuffer/Builder for two concats; IIRC the
tradeoff comes after ~6+ concats.
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong
> documentation
> ----------------------------------------------------------------------------------------
>
> Key: WW-3094
> URL: https://issues.apache.org/struts/browse/WW-3094
> Project: Struts 2
> Issue Type: Bug
> Components: Documentation
> Environment:
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong
> documentation
> Reporter: Martin Gainty
> Priority: Minor
>
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt
> accomodate getRealPath
> try {
> JasperCompileManager.compileReportToFile(
> "S2_WEBAPP/jasper/our_jasper_template.jrxml",
> "S2_WEBAPP/jasper/our_compiled_template.jasper");
> } catch (Exception e) {
> e.printStackTrace();
> return ERROR;
> instead of "S2_WEBAPP/jasper/our_jasper_template.jrxml"
> should be:
> StringBuffer
> sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
> //then just tack on your jrxml filename
> path1=sb.append("/jasper/scrounger_report.jrxml").toString();
> //then just tack on your our_compiled_template.jasper
> path2=sb.append("/jasper/our_compiled_template.jasper").toString();
> try {
> JasperCompileManager.compileReportToFile(
> path1,
> path2;
> } catch (Exception e) {
> e.printStackTrace();
> return ERROR;
> HTH
> MCG 21 April 2009
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.