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 configuration files are used in struts?

540


How can we get Servlet API Request, Response, HttpSession etc Objects in action classes?

635


Give an example of validates method used to avoid errors.

518


How many action classes can be used in struts application?

519


What is the purpose of @before annotation?

595






Why use spring, if you are already using struts?

567


Explain architecture of struts2?

594


What is the purpose of @doublerangefieldvalidator annotation?

568


What is the forward action utilized for?

562


What is struts and why it is used?

509


How can link tag’s action attribute be used?

534


Why aren’t the struts tags maintained as part of the jakarta taglibs project ?

560


What’s the difference between struts and espresso?

510


What is role of actionservlet?

575


What is the purpose of @keyproperty annotation annotation?

590