Can we have more than one instance of ActionServlet in a STRUTS based application?
If Yes, can anybody please explain.
My thoughts: ActionServlet is the central controller in STRUTS. All requests to the appropriate action classes, get routed through the ActionServlet. Looking into the implementation of an application server, an application server, maintains one instance of the ActionServlet and spawns a new thread, to process a request. Yes, we can have more than one instance of the ActionServlet, however, this would cause redundancy in the system.
SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Originally posted by JayaSiji Gopal: Can we have more than one instance of ActionServlet in a STRUTS based application?
The Struts ActionServlet is no different from any other Servlet. The application server creates only one instance of any Servlet per JVM, and then spawns threads to use that instance.
Even if you defined two different servlet stanzas in your web.xml file that both referenced the Struts ActionClass, the mapping you define ("*.do") could only reference one of them, rendering the other useless. [ February 12, 2007: Message edited by: Merrill Higginson ]