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 66 of 102    Print  
how can container will know this is a struts application?

  
Total Answers and Comments: 7 Last Update: February 04, 2007     Asked by: purandhar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 27, 2006 13:18:15   #1  
nitin        

RE: how can container will know this is a struts appli...
in the web.xml you have to put the servlet entry(org.apache.struts.action.ActionServlet)  which is nothing but action servlet. So each request will be handled by action servlet and then it will be forwarded to assingned mapping. Mapping is all done in struts.xml. i think in this very good site people should contribute by putting good question
 
Is this answer useful? Yes | No
August 31, 2006 10:34:38   #2  
khan        

RE: how can container will know this is a struts appli...

Hi, If Action servlet handle every reqest then, what about Action class ll do. What we have to tell, i think Action class forward the request. What is action class exactly.


 
Is this answer useful? Yes | No
September 15, 2006 03:15:15   #3  
skravipati Member Since: September 2006   Contribution: 2    

RE: how can container will know this is a struts appli...
Hello Everyone...ActionServlet is the controller, it juz controlls the whole application by sending request to ActionForm and ActionAction Class will handle only the bussiness logic....according to the BL the request is forwarded to respective .jspAny mistakes plz correct it...ThanxSatish...
 
Is this answer useful? Yes | No
September 22, 2006 22:28:05   #4  
sivaprasad        

RE: how can container will know this is a struts appli...
HI .. I will clearly explain about what ActionClass and What is Acton Servlet? Action Servlet: ------------------- Action Servlet is class that is a main controller, It is responsible for receiving all HTTP servlet request.It is available in struts frame work itself. Action Class: --------------------- Action is a class that can be used in controller layer where we are extend Action class for our own MyAction class to override execute method in control layer.Using execute method we can access request objects In web.xml we are configuring for only Action Servlet class only.That's why we are saying struts is front cotroller design pattern. All the request.passed through only one servlet.I think when alll request is processed through one sevlet then container knows this is a struts application.
 
Is this answer useful? Yes | No
December 06, 2006 02:28:33   #5  
kiran annam        

RE: how can container will know this is a struts appli...
i can explain it to the point when ever a request is invoked the container will invoke the excute method of action servlet and checks for the web.xml for org.apache.struts.action.ActionServlet and it mapped to sturts-config.xml file and there we r giving path which ends with( .do)and with this it can recongise as an struts application.
 
Is this answer useful? Yes | No
January 16, 2007 18:42:21   #6  
Smita Patnaik        

RE: how can container will know this is a struts appli...

web.xml is the file in which ActionServlet( which is the controller servlet for a Struts application) is defined.

web.xml will be read by container when we start the container.

So then itself the container will know that it is a struts application.


 
Is this answer useful? Yes | No
February 04, 2007 14:44:04   #7  
Salahuddin Munshi        

RE: how can container will know this is a struts appli...
Container doesn't know about any thing. what ever is configured in application's web.xml it will take it as a configuration. We can configure our own MVC implmentation and front controller in application configuration (i.e. web.xml) instead of ActionServlet. Container only take ActionServlet as another servlet context mapping. once request come for that context (/*.do), container instantiate the ActionSerlet (struct servlet) if it's not already created. Then it will call serlet init method for initialization. In init method ActionServlet do all initialization work with the help of struct config.xml (multiple config file in case of moduler approache). And in service method of ActionServlet it will call execute method of specific action mapped class. That a brief info about life cycle. Container doesn't know about which application is strut application. all it know is a sevlet and context mapping. Hope I answer the question.
 
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