FileInputStream and FileNotFound Exception

后端 未结 5 1963
慢半拍i
慢半拍i 2021-01-28 11:05

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         


        
5条回答
  •  面向向阳花
    2021-01-28 11:51

    I've seen this kind of problem many times, and the answer is always the same...

    The problem is the file path isn't what you think it is. To figure it out, simply add this line after creating the File:

    System.out.println(report.getAbsolutePath());
    

    Look at the output and you immediately see what the problem is.

提交回复
热议问题