How to explain struts work flow
Answer Posted / shiva
1. A request comes in with a .do extension, the container maps it to
the ActionServlet.
2. The ActionServlet acts like a front end controller and dispatches
control to a RequestProcessor.
3. The RequestProcessor finds an action tag with a path attribute that
matches the incoming request
4. Then the RequestProcessor looks for a form-bean tag that has a name
attribute that matched the action tags name attribute.
5. RequestProcessor instantiates a FormBean of the of based on the type
attribute
6. RequestProcessor calls populates the FormBeans fields from the
incoming request, then calls its reset method, then its validate method
7. RequestProcessor instantiates an Action based on the action tags
type attribute
8. RequestProcessor calls the action's execute method which returns
an ActionForward.
9. The RequestProcessor finds a matching ActionForward first within the
nested forward tags, then from within the global-forwards tag.
Note: if the validate method returns an ActionMessage then the
RequestProcessor forward the request to the resource specified in the
action's input attribute
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is http forward?
Can we have more than one struts-config.xml file for a single struts application?
Which configuration files are used in struts?
How struts2 supports internationalization?
How to combine the struts with velocity template?
What is the use of execAndWait interceptor?
How to work with error tags?
Why do the struts tags provide for so little formatting?
What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?
What is defeult result type?
What are the benefits of Interceptors in Struts2?
in struts how to use hibernate with struts>
What's mvc pattern ?
Can a reducer dispatch an action?
What is controller in struts2?