You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Denis Avdic <de...@gmail.com> on 2004/10/05 16:20:49 UTC

Load-on-startup init servlet

I am trying to set up a start up sequence for my app but I have never
set up something like that.

Basically I want to initialize some classes with attributes found in
my resources file.  How would I go about doing this?  I set up my
web.xml file to load a servlet on startup, but I am not sure how I am
supposed to get to the message resources that are loaded in the
ActionServlet.

I know I saw this done before but I can't remember how it was set up.

Thanks.  

Denis

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


Re: Load-on-startup init servlet

Posted by Denis Avdic <de...@gmail.com>.
So I can call MessageResources.getMessageResources("blah") in the init() method?
Is there an order I have to load the servlets in web.xml in order for
that to work?  (if I remember correctly, ActionServlet actually loads
those resources, right?)


On Tue, 5 Oct 2004 07:49:02 -0700 (PDT), Varun Garg
<va...@yahoo.com> wrote:
>     MessageResources res =
> MessageResources.getMessageResources("ApplicationResources");
> 
> If you are using the property file name
> ApplicationResources in the root folder.
> 
> In the init method of the servlet that you are loading
> at startup, you can do whatever you want.
> 
>    public void init(ServletConfig config) throws
> ServletException {
> 
> 
> 
> 
> --- Denis Avdic <de...@gmail.com> wrote:
> 
> > I am trying to set up a start up sequence for my app
> > but I have never
> > set up something like that.
> >
> > Basically I want to initialize some classes with
> > attributes found in
> > my resources file.  How would I go about doing this?
> >  I set up my
> > web.xml file to load a servlet on startup, but I am
> > not sure how I am
> > supposed to get to the message resources that are
> > loaded in the
> > ActionServlet.
> >
> > I know I saw this done before but I can't remember
> > how it was set up.
> >
> > Thanks.
> >
> > Denis
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: Load-on-startup init servlet

Posted by Varun Garg <va...@yahoo.com>.
    MessageResources res =
MessageResources.getMessageResources("ApplicationResources");


If you are using the property file name
ApplicationResources in the root folder.

In the init method of the servlet that you are loading
at startup, you can do whatever you want.

   public void init(ServletConfig config) throws
ServletException {




--- Denis Avdic <de...@gmail.com> wrote:

> I am trying to set up a start up sequence for my app
> but I have never
> set up something like that.
> 
> Basically I want to initialize some classes with
> attributes found in
> my resources file.  How would I go about doing this?
>  I set up my
> web.xml file to load a servlet on startup, but I am
> not sure how I am
> supposed to get to the message resources that are
> loaded in the
> ActionServlet.
> 
> I know I saw this done before but I can't remember
> how it was set up.
> 
> Thanks.  
> 
> Denis
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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