• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts question

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by JayaSiji Gopal:
Can we have more than one instance of ActionServlet in a STRUTS based application?


No.

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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic