I am trying to retrieve a jrxml file in a relative path using the following java code:
String jasperFileName = \"/web/WEB-INF/reports/MemberOrderListReport.jrxm
You're trying to treat the jrxml
file as an object on the file-system, but that's not applicable inside a web application.
You don't know how or where your application will be deployed, so you can't point a File
at it.
Instead you want to use getResourceAsStream
from the ServletContext
. Something like:
String resourceName = "/WEB-INF/reports/MemberOrderListReport.jrxml"
InputStream is = getServletContext().getResourceAsStream(resourceName);
is what you're after.