132014Aug

Request Flow of Struts 1.x

There is following task is happening when you deploy any web-application which is developed in Struts 1.x,

Step 1:- All Step of web-application deployment will be done first Process Steps of any web-application at deployment

Step 2:- Because of configuring ActionServlet with <load-on-startup> tag, ActionServlet is initialized at container startup.

Step 3:- Container invokes service(request,response) method of ActionServlet.

Step 4:- ActionServlet Collects all incoming requests and delegates to RequestProcessor.

Step 5:- RequestProcessor checks whether the requested resource is available or not, if not available then error message will be given with http status code 404.

Step 6:- If requested resource is available then it will check whether that resource contains any <html:form> tag. if not available then error message will be given with http status code 500.

Step 7:- if available then it will check in struts-config.xml file whether any tag is available which action attributes value is same as path attributes value.

Step 8:- if matching action is found then RequestProcessor takes name attributes value.

Step 9:- RequestProcessor checks whether any

tag is available in struts-config.xml file whose name attributes value is same as name attributes value.

Step 10:- If matching then it will take the <form-bean> type attribute value and load that class.

Step 11:- Create the instance of that class and initialized value by using setter method and the value comes from form after that call validate() method if no error returns from validate() method.

Step 12:- Takes the <action> type attribute value and call that execute() method of action class.

Step 13:- If execute() method execution is over then based on returning value it will match in <forward> name attribute value and render that .jsp file to client.