tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Isaacs" <Larry.Isa...@sas.com>
Subject RE: Modifying Tomcat to have WEB-INF/config in Classpath
Date Tue, 27 Aug 2002 12:59:36 GMT
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>


Mime
View raw message