GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Struts
Go To First  |  Previous Question  |  Next Question 
 Struts  |  Question 98 of 102    Print  
Struts ActionServlet
why do we have only one ActionServlet in Struts?
(Asked in Polaris Interview for Java Experienced people , on April 11, Chennai)



  
Total Answers and Comments: 4 Last Update: June 18, 2008     Asked by: khadarzone 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 16, 2008 09:34:25   #1  
satheeshraja Member Since: December 2007   Contribution: 2    

RE: Struts ActionServlet
ActionServlet is like BackBone of our application, we have done all actions(request & response) by using only one instance, that is ActionServlet's Instance, that is the main reason to go for MVC architecture, no need to create more than one instance, thats why we use only one ActionServlet for whole project.

In Previous Structure, we should create new instance for each and every request, in MVC no need.

Note of it "we have only one Backbone in our BODY"

 
Is this answer useful? Yes | No
May 18, 2008 07:08:15   #2  
jaquline.phoenix Member Since: May 2008   Contribution: 1    

RE: Struts ActionServlet
The ActionServlet is the Controller comonent that handle the client request and determines which Action class will process each received request. As in MVC2 architecture only one controller component should govern the flow of application -i mean when request is generated ,it should be served by action class and based on the outcome next view is selected (internally RequestDispatcher forward()  method is used to choose next view). All business logic is executed by Action class ,so ActionServlet does not have such overhead that we need multiple instances .

What is ur take ?

 
Is this answer useful? Yes | No
June 09, 2008 10:03:24   #3  
ratheeshkn Member Since: June 2008   Contribution: 1    

RE: Struts ActionServlet
An action servlet is a servlet that is started by the servlet container of the web server in order to process the request.

The servlet receives a request fromt he action and asks the servlet container to pass the request to the forward's URL.

Its the primary component of the controller and it should be and instance or a sub class of org.apache.struts.action.ActionServlet.

 
Is this answer useful? Yes | No
June 18, 2008 11:03:02   #4  
CatchSandeepVaid Member Since: June 2008   Contribution: 1    

RE: Struts ActionServlet
he Jakarta Struts Framework does not support configuring more than one Struts ActionServlet in the Web deployment descriptor. This limitation occurs because there is only one servlet context per Web application and the commons digester imports the Struts configuration into the servlet context. Struts stores the required information as attributes in the servlet context, and the information is retrieved by using globally defined key names. Struts will suffix these attribute names with the prefix of the Struts modules, so several Struts modules are supported in a single Web application, but multiple Struts applications are not.

http://publib.boulder.ibm.com/infocenter/wpdoc/v510/index.jsp?topic=/com.ibm.wp.ent.doc/wps/multi_struts.html

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape