You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rob <ja...@hotpop.com> on 2003/03/09 13:23:18 UTC

application configuration suggestions

I have a number of variables I would like to specify to my application at startup time.
I was wondering what the best method to do this is?  Does struts provide any facilities
related to this?

An example of a configuration value would be that I want to be able to specify the
location of a set of files on the disk.

Rob

AW: application configuration suggestions

Posted by Roland Berger <be...@bluewin.ch>.
Hi Rob

If you work with struts 1.1 beta xy you can use a plugin for this. You have
to implement the init() method.

public class InitPlugin implements org.apache.struts.action.PlugIn {


    public void destroy() {
        // code to free resources
    }

    public void init(ActionServlet actionServlet, ModuleConfig moduleConfig)
throws ServletException {
       // Code to initialize your variables
    }

Entry in struts-config.xml :

    <plug-in className="InitPlugin">
    </plug-in>

Struts will call the init() on startup and destroy() on shutdown.

Roland

-----Ursprüngliche Nachricht-----
Von: Rob [mailto:java_list@hotpop.com]
Gesendet: Sonntag, 9. März 2003 13:23
An: struts-user@jakarta.apache.org
Betreff: application configuration suggestions


I have a number of variables I would like to specify to my application at
startup time.
I was wondering what the best method to do this is?  Does struts provide any
facilities
related to this?

An example of a configuration value would be that I want to be able to
specify the
location of a set of files on the disk.

Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org