How to explain struts work flow

Answer Posted / madhu

1) A request comes in from a Java Server Page into the
ActionServlet.
2) The ActionServlet having already read the
struts-config.xml file, knows which form bean
relates to this JSP, and delegates work to the validate
method of that form bean.
3) The form bean performs the validate method to determine
if all required fields have been entered, and performs
whatever other types of field validations that need to be
performed.
4) If any required field has not been entered, or any field
does not pass validation, the form bean generates
ActionErrors, and after checking all fields returns back to
the ActionServlet.
5) The ActionServlet checks the ActionErrors that were
returned from the form bean’s validate method to determine
if any errors have occurred. If errors have occurred, it
returns to the originating JSP displaying the appropriate
errors.
6) If no errors occurred in the validate method of the form
bean, the ActionServlet passes control to the appropriate
Action class.
7) The Action class performs any necessary business logic,
and then forwards to the next appropriate action (probably
another JSP).

Is This Answer Correct ?    167 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does it cost to replace struts?

504


What is the role of action class?

568


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

504


What is controller in struts ?

535


List some struts tag libraries?

561






What are the steps required for setting up validator framework in struts?

563


What are the core classes of struts?

574


What do you mean by action errors and what are the results they force?

577


Can a reducer dispatch an action?

501


What is the naming convention for a resource bundle file in struts2?

541


What is struts xml?

441


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

567


Which interceptor is responsible for i18n support?

520


What are the benefits of Interceptors in Struts2?

655


What is front controller in struts2?

552