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



How Struts internally works? For Example if we type the URL "/login.do" how the process ..

Answer / 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

More Struts Interview Questions

What is request processor and how does it relates to action mapping?

0 Answers  


how you provide security in your banking project

1 Answers   IBM,


When wil use singleton class in Struts

7 Answers  


when connecting with the database,if database server is down,ho can we handle this exception in struts,how can we send error message to the user?

4 Answers   Wipro,


What is interceptor in Struts2?

0 Answers  






Name some of the features of struts2?

0 Answers  


What is Hibernate?

4 Answers  


What is strut web xml?

0 Answers  


Is it possible to create mulitple instance of one Action Class in struts?

10 Answers   Satyam,


can anyone help me to send the code for Jasper Reporting in java?plz

3 Answers   CSC, RFT,


What is actionservlet?

0 Answers  


If the framework doesn’t do what I want, can I request that a feature be added?

0 Answers  


Categories