velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hanasaki JiJi <hanas...@hanaden.com>
Subject config properties file fails to load on tomcat 4.1.12
Date Fri, 20 Dec 2002 04:19:03 GMT
config properties file  fails to load on tomcat 4.1.12
the war is not unpacked

the properties config file is under
/WEB-INF/velocity/velocity-config.properties

The below code throws FileNotFoundException

         /*
          *  now convert to an absolute path relative to the webapp root
          *  This will work in a decently implemented servlet 2.2
          *  container like Tomcat.
          */
	propsFile = "/WEB-INF/velocity/velocity-config.properties"
         if ( propsFile != null ) {
             String realPath =
		getServletContext().getRealPath(propsFile);
             if ( realPath != null ) {
                 propsFile = realPath;
             }
         }

         p.load(new FileInputStream(propsFile));

How can the properties file be loaded?

Thanks


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


Mime
View raw message