Today, I will stop it in the afternoon, it is really ◎ # ¥% ... ※ ×
, I have to read the book. Summarize some of the understanding of Struts about MVC. Struts tags and form submission process is organized.
Struts implements the Controler section, that is, the ActionServlet class, usually use Struts to hand over all .do requests to this class, this class is processed by that Action object according to the struts-config.xml configuration file. To make Struts's ActionServlet class, you should declare in Web.xml, initialize struts-config.xml mapping. DO request
servlet-maping>
......
servlet>
The view is a pile of JSP files that can be used with the label library provided by Struts. Model, to inherit the Actionform, and the FORM in the web page corresponds, the simple model is set / get and verify validate. Then hand it over to the action. I don't know if the action belongs to that section, it seems that it is not enough. This is still not understood. Release LoginAction requires struts-config.xml configuration: one example
Tomcat load process.
Use the label form:
Read the text from the Application.properties file, replace the corresponding label code with the "tab of the" HTML: Form> to find the corresponding form bean in the Session range, if there is such an instance, the property in the origan is mapped to Form In the input text box of the form. Not ignored.
submit Form:
Servlet / JSP container finds * .do's servlet-mapping: action in a web.xml file. Find the corresponding ActionServlet class in the servlet-name in the servlet element according to the settings in Struts-Config.xml, create the corresponding FORM object, pass the form data submitted by the customer to the FORM object, this object is saved within the session range if FORM has a Validate method, if the verification failed (here, the defense requirements such as format) VALIDATE method returns an ActionerRors object, contains an actionerror object ActionServlet from struts-config.xml to find the