struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gemes Tibor <>
Subject Re: AW: loading configuration on startup
Date Wed, 22 Jan 2003 12:13:07 GMT
2003. január 22. 12:59 dátummal Softwareentwicklung Hauschel ezt írtad:
> But my are a log4j.xml file.
> That doesn't work in classpath ;-(
> In addition there are mor configurations i need for the whole applikation.

I can't see why can you not pick up the init-params in your serlvet's init() 
method. It's so easy. 
For each servlet I wrote I provide the config parameter which is an xml file. 
This xml is parsed with Digester. 
This is how I do it, and do not be surprised if you see some coincidence with 
the ActionServlet's init() method...

    public void init() throws ServletException {
        String value;

        try {
            LOG.debug("start init");
            // Initialize the context-relative path to our configuration 
            value = getServletConfig().getInitParameter("config");
            if (value != null)
                config = value;
            // Acquire an input stream to our configuration resource
            InputStream input = 
            if (input == null)
                throw new UnavailableException
                ("config file '" + config + "' is missing");

            Digester digester = null;
            digester = initDigester();



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message