geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul McMahan <>
Subject Re: File paths within the EAR file
Date Fri, 17 Feb 2006 16:44:14 GMT
Hi,  I assume you are trying to access the properties file from a servlet
since its name is passed as a servlet init-param.  Depending on what your
end goal is there may be a standard servlet API that will help you out. For
example, from within your servlet you could use


if the servlet and properties file are in the same web app.  If they are in
separate web apps you could instead use

If you need an absolute path to the file then ServletContext.getRealPath(..)
could help.

Best wishes,

On 2/17/06, <> wrote:
> The hot deployment is excellent for the automation of the deployment.  But
> we ran into the problem of inability to specify the file path of the
> property files.
> We have the file path information in the web.xml as shown below
> <servlet id="Servlet_6">
>          <servlet-name>initialize</servlet-name>
> <servlet-class>com.web.someaction.InitializeServlet</servlet-class>
>           <init-param id="InitParam_i1">
>             <param-name>config</param-name>
>             <param-value>/opt/geronimo-1.0
> /deploy/some.ear/someweb.war/WEB-INF/classes/</param-value>
>          </init-param>
>          <load-on-startup>2</load-on-startup>
>       </servlet>
> Of course, geronimo will complain that it is not a directory.  Then we
> cannot predict the numeric directory name under /opt/geronimo- 1.0
> /config-store  For the subsequent deployment, we know where the some.ear
> will be expanded into.  Would I have to deploy the application once for
> the
> first time just to know the /opt/geronimo-1.0/config-store/${NUMBER}?  Or
> is there any other way around this?
> Many thanks again in advance.
> Young

View raw message