• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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 ]
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic