This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I am developing a web application (JSF) with NetBeans 7.1 and JasperReports 4.5.1.
I have a problem with determining the correct path in which to place the folder 'reports' that contains the *. Jasper and how to retrieve files from code.
The fragment that does not work is as follows:
The error is "java.io.FileNotFoundException: \reports\ElencoPersone.jasper"
Thanks to all who want to give me their suggestions.
Since what came back was a filepath in Windows format, I'll assume you're running on a Windows machine. Windows, unlike Unix/Linux does not have a single filesystem root, but rather one root per drive, and in the absence of an explicit drive ID, it will use the "current" drive, which isn't guaranteed predictable. So a better path would be something like:
If you want to store the report template as part of the webapp (WAR) itself, you need a slightly different approach. Probably something like this:
I placed the reports prototype directory under WEB-INF for better application security. I'm fairly certain that Jasper can use an inputstream as a template source.
Being persecuted doesn't in any way prove your righteousness or your beliefs. Many people get persecuted because they are repugnant or annoying. Or just because they can be.