Probably a Java expert could help more, but I think you can use a
ResourceBundle (and place the properties in your package with your java
class files) to retrieve it or even a URL to load the properties file.

URL method psuedo code:
Properties props = new Properties();
URL url = new URL(http://localhost:8080/mywebapp/test.properties);
props.load(url.openStream());
//props.load(InputStream is) is the method defintion so any InputStream will
work

ResourceBundle psuedo code:
ResourceBundle myResource = ResourceBundle.getBundle("
com.yourcompany.yourpackage.jndi");
String myProperty = myResource.getString("mypropertyname");



On 5/3/06, Feris Thia <[EMAIL PROTECTED]> wrote:

Ic.... so we cannot just load it from the directory where jsp are and
use this code ?

=====================================
InitialContext jndiContext = new InitialContext();
=====================================

On 5/3/06, abdurrahman sahin <[EMAIL PROTECTED]> wrote:
>
> i think , it is actully related to where you are looking for.
> i think you can put it anyware as long as the diretory you put it is
> accessible.
>
> http://asahin.net
>
> private static final String CONFIG_FILE="resources/jndi.properties";
> FileInputStream fis = new FileInputStream(CONFIG_FILE);
>                         myProperties.load(fis);
>
>


--
Regards,
Feris
PT. Putera Handal Indotama
JL. KH. Moh. Mansyur No. 11 Blok B.8-12
Telp. +62-21-631 6688 (Hunting)
Fax. +62-21-6330211
Jakarta (10140) - INDONESIA

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Marc Farrow

Reply via email to