Commits

Anonymous committed c7bac46

fixes jasper issue for good

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2122573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 5da6613

Comments (0)

Files changed (1)

File webapps/showcase/src/java/com/opensymphony/webwork/showcase/jasper/JasperAction.java

 
 import java.util.ArrayList;
 import java.util.List;
+import java.io.File;
 
 import net.sf.jasperreports.engine.JasperCompileManager;
 
            * If you don't have to compile the report, you just setup your data source (eg. a List), and skip this
            */
         try {
+            String reportSource = ServletActionContext.getServletContext().getRealPath("/jasper/sample_report.jrxml");
+            File parent = new File(reportSource).getParentFile();
             JasperCompileManager.compileReportToFile(
-                    ServletActionContext.getServletContext().getRealPath("/jasper/sample_report.jrxml"),
-                    ServletActionContext.getServletContext().getRealPath("/jasper/sample_report.jasper"));
+                    reportSource,
+                    new File(parent, "sample_report.jasper").getAbsolutePath());
         } catch (Exception e) {
             e.printStackTrace();
             return ERROR;