Get the App
SLTechnology News&Howtos  ›  Development  › 

Introduction to the work flow of Struts

Shulou Source: shulou.com Published: 2022-06-03 14:53:12 11月14日 Update

This article mainly explains the "introduction to the workflow of Struts". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the "introduction to the workflow of Struts".

1. When the web application starts, load and initialize the ActionServlet,ActionServlet to read the configuration information from the struts-config.xml file and store it in each configuration object.

two。 When ActionServlet receives a customer request, it first retrieves the ActionMapping instance that matches the user request, and returns the invalid information of the user request path if it does not exist.

3. If the ActionForm instance does not exist, create an ActionForm object to save the form data submitted by the customer into the ActionForm object.

4. Determine whether form validation is required based on the configuration information. If validation is required, the Validate () method of ActionForm is called. If the Validate () method of ActionForm returns null or an ActionErrors object that does not contain ActionMessage, the form is validated successfully.

5.ActionServlet decides which Action to forward the request to based on the mapping information contained in the ActionMapping instance. If the corresponding Action instance does not exist, create it first, and then call the execute () method of Action.

The execute () method of 6.Action returns an ActionForward object, and ActionServlet forwards the customer request to the JSP component pointed to by the ActionForward object.

The jsp component pointed to by the 7.ActionForward object generates a dynamic web page and returns it to the customer.

Thank you for your reading, the above is the content of "introduction to the workflow of Struts". After the study of this article, I believe you have a deeper understanding of the introduction of the workflow of Struts, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Objects instances workflows processes work information customers methods validation forms learning configuration content pointing users components success dynamics that is ideas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Huawei MariaDB macOS