Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get the Inputstream of jasper file from a specific path

Habib EslamiSep 21 2014 — edited Sep 21 2014

Hi

I use jdev 11.1.1.7.0

I need to get the InputStream of jasper file in my application to show report as a PDF. I do this through below codes:

ServletContext context = getContext();

InputStream inputstream = context.getResourceAsStream(repPath); //  repPath = "reports/reportName.jasper"

whereas the repPath is the folder that exist in the current application(ViewController\public_html\reports\reportName.jasper)

but I want to put all reports in a specific folder like "d:\reports", and all of applications call reports from this path.

but when I set repPath = "d://reports//reportName.jasper" , the inputstream variable in the below code is null

InputStream inputstream = context.getResourceAsStream(repPath); //  repPath = "d://reports/reportName.jasper"

I need to have a specific path for all reports, because some reports may be called from many applications, can anyone help me?

Habib

Regards

This post has been answered by kdario on Sep 21 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2014
Added on Sep 21 2014
3 comments
949 views