on 08-24-2006 2:11 PM
Hi,
Im trying to load a properties file which i put under my project/conf/my.properties. I tried to load it using:
FileInputStream fis = new FileInputStream(new java.io.File( "conf\ewl.properties"));
but this result in a file not found. Can anyone tell me how i can load the properties file.
Much thanks,
Hugo
Hugo,
Place the file under "src" folder, say to path src/com/company/app/config
Now you can get properties via:
final Properties myProps = new Properties();
myProps.load(
this.getClass().getClassLoader()
.getResourceAsStream("com/company/app/config/ewl.properties")
);
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hugo,
to load a properties file which is deployed with your Web Dynpro project you can apply the <b>WDResourceHandler </b>service API.
Read the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/4a417a90-0201-0010-f499-8d41fc78c837">Web Dynpro Quiz Tutorial</a>, pages 40-42:
Regards, Bertram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.