Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How Struts internally works?
For Example if we type the URL "/login.do" how the process
goes internaly? How the struts-config.xml loaded?

Answer Posted / narendra kakumanu

Struts-Flow:-

* Whenever we deploy the application into the server it reads the web.xml file and finds the load on startup for action servlet the action servlet object will be created and init method will be invoked.

* struts-config.xml is one of the init parameter of the action servlet so it will read the struts-config.xml at the time of deployment because of load on startup.
* now everything is loaded and ready to serve.

* whenever user sends a request it goes to the web.xml file checks the url-pattern and it matched it will take servlet dummy name and checks with the servlet name and it will invoke action servlet object.

* srtuts-config.xml is one of the init parameter of the action servlet it will delegate the same request to the struts-config.xml.

* In struts-config.xml file it will check the action tag path attribute it will matched take the action name and check with the respective form bean name and creates the form bean object and all the requested parameters are populated into the form bean object.

* Controller come back to the action tag and check the validate attribute either true or false by default it is true if it is true it will perform the validation on the form bean object.

* validate method return type is action errors .

* if validations are true it will return null so that time it will create action class object and invoke the execute method.

* if validations are failed it will return action errors to respective page which is configured in input attribute.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of Interceptors in Struts2?

1116


What is the purpose of struts.properties in struct2?

893


What are action errors and error and what are the consequences they impose?

951


Explain integrate log4j in struts2 application?

957


Which library is provided by struts for form elements like check boxes, text boxes etc?

878


Name some of the features of struts2?

984


What are the main classes which are used in struts application?

933


What are the two scope types for formbeans?

1159


Explain the difference between jakarta struts and apache struts?

909


How struts2 supports internationalization?

1080


What is struts 2 framework in java?

988


Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?

879


How client side validation is enabled on a jsp form?

1015


Explain about tiles?

1001


Which configuration file is used for storing jsp configuration information in struts?

946