Re: get webapp root directory from action constructor

2006-11-06 Thread Antonis Lebesis
Hello, I don't know if you still need it, but the "correct" way is to add a ServletContextListener. To do this, you have to implement the ServletContextListener interface: public class FooContextListener implements ServletContextListener { public void contextInitialized(ServletContextEve

Re: get webapp root directory from action constructor

2006-11-04 Thread Patrice Le Cozler
On 11/3/06, Craig McClanahan <[EMAIL PROTECTED]> wrote: On 11/3/06, Patrice Le Cozler <[EMAIL PROTECTED]> wrote: > > Hi, > I want to load a property file at webapp start. Since that property file > is > located in my webapp's directory structure, I want to be able to determine > its absolute nam

Re: get webapp root directory from action constructor

2006-11-03 Thread Craig McClanahan
On 11/3/06, Patrice Le Cozler <[EMAIL PROTECTED]> wrote: Hi, I want to load a property file at webapp start. Since that property file is located in my webapp's directory structure, I want to be able to determine its absolute name at runtime. I tried "this.getServlet().getServletContext().getReal

Re: get webapp root directory from action constructor

2006-11-03 Thread Mike Baroukh
Maybe you can - override setServlet() and do it after the servlet had benn set - do another servlet that will load at startup and whose only job is to find path ... Mike Patrice Le Cozler a écrit : Hi, I want to load a property file at webapp start. Since that property file is located in my

get webapp root directory from action constructor

2006-11-03 Thread Patrice Le Cozler
Hi, I want to load a property file at webapp start. Since that property file is located in my webapp's directory structure, I want to be able to determine its absolute name at runtime. I tried "this.getServlet().getServletContext().getRealPath(PROPS_FILE)" but "getServlet()" returns null when call