Excuse me for the question
but cannot u store directly the properties (strings, integer and so on) in
the web.xml for the application or the server.xml under <Resource....

 -------------------------
Simone Chiaretta
www.piyosailing.com/S
Any sufficiently advanced technology is indistinguishable from magic

> -----Messaggio originale-----
> Da: Jos� Moreira [mailto:[EMAIL PROTECTED]
> Inviato: marted� 25 febbraio 2003 13.36
> A: Tomcat Users List
> Oggetto: properties files
>
>
> Hello, im using a propeties file to store and retrieve
> application settings
> (like db conection) using this code :
>
>     private Properties properties;
>
>     private String status;
>
>     private boolean NovoConfig;
>
>     /** Creates new ConfigReaderBean */
>     public ConfigReaderBean() {
>
>         Properties properties = new  Properties();
>
>         NovoConfig = false;
>
>         try {
>
>             properties.load(new FileInputStream("config.properties"));
>
>         } catch (IOException e) {
>
>
>             System.out.println("Erro ao ler config: "+e.getMessage());
>
>
>
> properties.setProperty("database.url","http://localhost/mysql";);
>
>             NovoConfig = true;
>
>         }
>
>         if (NovoConfig) {
>
>             try {
>
>                 properties.store(new
> FileOutputStream("newconfig.properties"),null);
>
>                 System.out.println("Criado: newconfig.properties");
>
>             } catch (IOException e) {
>
>                 System.out.println("Erro ao criar novo config:
> "+e.getMessage());
>
>             }
>
>
>         }
>
> the problem is that it doesnt load the file and saves the
> 'newconfig.properties' file under the Netbeans IDE dir,
>
> how can i load the file located under my webapp WEB-INF dir ?
>
>
>
>
>
> ---------------<*>----------------------
> Jos� Moreira
>
> T�cnico de Inform�tica | IT Technician
>
> Vila Nova de Gaia, Portugal
>
> E-Mail: [EMAIL PROTECTED]
>
> MSN: [EMAIL PROTECTED]
>
> ICQ: 136936120
>
> IRC: ethernal (irc.ptnet.org)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to