Displaying Jasper report in struts web app - HELP!

I am currently developing my first struts-based web application. So far so good until I tried to display a Jasper report - mass headaches!
I have used iReport to produce a compiled .jasper file but I cannot seem to access it at all.
I am getting file not found errors all over the place!
My code (version 565!) is:

File reportFile = new File("/reports/TestThree.jasper");
String path = reportFile.getPath(); //tried getAbsolutePath()
Map parameters = new HashMap();
parameters.put("TourID", "INV 55");
JasperPrint jasperPrint = JasperManager.fillReport ( path,parameters, conn);
JasperManager.printReportToPdfFile(jasperPrint, "TestThree.pdf");

My folder (records) is directly under the root folder.
Does anyone have any suggestions or any example code of running a Jasper report in the struts environment?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!