Kazumi ,

     You need to look at the struts-example.war application for how to do
this. Basically create your own servlet where you initialize your beans.
Once the beans are initialized , put them in application scope. Then startup
your action servlet. To do this you need to use the web.xml file to specify
the order in which the servlets need to be loaded. This way you will not be
tinkering with the ActionServlet which will be a good thing if infuture you
want to migrate to struts1.1

cheers,
Amar..

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 10:38 PM
To: [EMAIL PROTECTED]
Subject: subclassing ActionServlet?


Hello struts-users,

My webapp needs bunch of beans that should be available
all the time and accessible from all JSP pages, so I guess I
have to create the beans at the startup time and set them to
the application context.

How should I do this? My candidates are,

1) create a subclass of ActionServlet and do it there,
2) create a subclass of Servlet (unrelated to ActionServlet)
    and do it there.

Which is better, or are there any other standard ways?
I don't see any examples that use subclasses of ActionServlet,
and I am wondering if there are some reasons not to.

Thanks in advance,

- kazumi

Reply via email to