Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use application resourceBundle?
dzish
Hi all,<br />
<br />
in my scripted datasource I need to call servlet in specific installation. The url of application is in location.properties in classpath of application.<br />
I tried in my javascipt scripted datasource to use<br />
<br />
var bundlePath = "../../../../../../location.properties";<br />
<strong class='bbc'>var bundleFile = new Packages.java.io.File(bundlePath);</strong><br />
var bundleInputStream = new Packages.java.io.FileInputStream(bundleFile);<br />
var bundle = new Packages.java.util.PropertyResourceBundle(bundleInputStream);<br />
<br />
But there is problem with FileNotFoundException - PermissionDenied. Do you know why i have no permission and <strong class='bbc'>how to open</strong> the resource bundle?<br />
<br />
thanks a lot<br />
Jan
Find more posts tagged with
Comments
dzish
Simply I used:
//location means file "location.properties" in classpath of web app
var bundle = new Packages.java.util.ResourceBundle.getBundle("location");
var message = bundle.geString(key);
I didn't know file path for new File(relativePath) begun in temporary java directory, not in path where code was executed.
And also I falsely expected classpath is classpath of birt application but it's classpath of web application (WEB-INF/classes).
so sorry for dummy question
Jan