(1. Your understanding of MVC, what are the advantages and disadvantages of MVC? Contact Struts to explain how to use it in a Web application? Answer: ?? MVC design method (structure method using observer method) M: Model (Business process layer), model , the business management layer that operates the data, and is independent of the play layer (Independentofpresentation). V: View(Presentationlayer), view, displays data through client data type, and echoes the performance results of the model layer. C: Controller (Controllayer), the controller, that is, the bridge between the view layer and the model layer, controls the flow of data, bears things sent by the view layer, and focuses on redrawing the view MVC structure An implementation model model II (Servlet-centric): JSP Servlet JavaBean, with control as the core, JSP is only responsible for displaying and collecting data, Sevlet, connecting view and model, sending view layer data to model layer, JavaBean, divided into business class and data entity, business class manages business Data, data entities, carrying data, basically most projects use this MVC implementation. StrutsMVC structure (Webapplicationframeworks) Struts is implemented using the second implementation of MVC, that is, the controller is the core. Struts provides some components to develop applications using MVC: Model: Struts does not provide a model class. This business logic must be provided by the developer of the Web application in the form of JavaBean or EJB View: Struts provides an actionform to create a formbean, which is about transferring data between the controller and the view. In addition, Struts provides a custom JSP tag library to assist developers in creating interactive form-based applications with JSP, using program resource files to retain some text constants and error messages, which can be converted into other languages. middle. Controller: Struts provides a core controller ActionServlet, through this core controller to call the custom controller Action registered by other users, the custom Action needs to conform to the Struts custom Action standard, and also needs to be in struts-config .xml to configure in a specific configuration file, receive JSP input fields to form Actionform, and then call an Action controller. The logical interface of the model is provided in the Action controller.
Partial interview questions answers.doc)