tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Michenaud" <lmichen...@adeuza.fr>
Subject RE: Modifying Tomcat to have WEB-INF/config in Classpath
Date Tue, 27 Aug 2002 13:48:13 GMT
Because i read the properties in a interface like this :

package com.a2a.util ;
public interface A2aConstantes
{
  public static final String SCHEMA =
  java.util.ResourceBundle.getBundle("db").getString("schema");
}

I don't think i can read the property file as u do because
i can't do a getResourceAsStream()

> -----Message d'origine-----
> De : Larry Isaacs [mailto:Larry.Isaacs@sas.com]
> Envoyé : mardi 27 août 2002 15:00
> À : Tomcat Developers List
> Objet : RE: Modifying Tomcat to have WEB-INF/config in Classpath
> 
> 
> It is not clear why adding WEB-INF/config to the webapp
> classpath is necessary or why you would even want to.
> If you are simply trying to read a properties file:
> 
> <%
>     java.util.Properties props = new java.util.Properties();
>     props.load(application.getResourceAsStream(
>                 "/WEB-INF/config/myprops.properties"));
>     out.println(props);
> %>
> 
> works for me as a JSP test case.
> 
> Cheers,
> Larry
> 
> > -----Original Message-----
> > From: Laurent Michenaud [mailto:lmichenaud@adeuza.fr] 
> > Sent: Tuesday, August 27, 2002 8:29 AM
> > To: tomcat-dev@jakarta.apache.org
> > Subject: Modifying Tomcat to have WEB-INF/config in Classpath
> > 
> > 
> > Hi,
> > 
> > I want Tomcat 3.3.1 to have WEB-INF/config in the classpath( 
> > like WEB-INF/classes ).
> > 
> > I have modified the LoaderInteceptor11.java :
> > In the method addContext, i have added :
> > 
> > 	// Add "WEB-INF/config"
> > 	File d = new File(base + "/WEB-INF/config");
> > 	if( d.exists() ) {
> > 	    try {
> > 		URL url=new URL( "file", null,
> > 			d.getAbsolutePath().replace('\\','/') + "/" );
> > 		context.addClassPath( url );
> > 	    } catch( MalformedURLException ex ) {
> > 	    }
> >         }
> > 
> > 
> > I have recompiled Tomcat but it doesnot work.
> > My properties in WEB-INF/config are still not found.
> > 
> > Can anybody help me ?
> > Michenaud Laurent
> > - Adeuza -
> > [ Développeur Web - Administrateur Réseau ]
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:tomcat-dev-> unsubscribe@jakarta.apache.org>
> > For 
> > additional commands, 
> > e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-dev-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message