How many ActionServlets are created by struts based application?

Questions by katipelly

Showing Answers 1 - 10 of 10 Answers

Ritesh Kapse

  • Jun 11th, 2007
 

ActionServlet is a Servlet(Java Class).For one web application only one instance of Servlet is created which is multi threaded i.e.it will create separate thread of execution for each client.So, only one instance of ActionServlet will be created for each web application.

Regards
Ritesh
IDST Pune

Charles

  • Nov 27th, 2007
 

It would be misleading to say that only one instance of Servlet is created per web application. One instance of each Servlet class defined in your code is created per web application. i.e., If your application has 100 ActionServlet classes, you will have one instance of each ActionClass defined, which means, the web application would have 100 ActionServlet instances, corresponding to each ActionClass defined in your application. Now, for n users, every one of these instances would create a thread for each client.

When the client sends the request for that request one thread is created for that particular client. In te same way if multiple clients are send the request for the same web page here multiple threads are created with regarding their own ActionServlets so no confusion in between the clients.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions