找回密码
 立即注册
StrutstheControllerModel | 微处理器开发 2022-09-28 123 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
一、你对MVC的理解,MVC有啥优故障?联系Struts,说明在一个Web使用如何去使用?答:??MVC设计方式(使用观察者方式的结构方式)M:Model(Businessprocesslayer),模型,操作数据的业务管理层,并独立于发挥层(Independentofpresentation)。V:View(Presentationlayer),视图,通过客户端数据类型显示数据,并回显模型层的履行成果。C:Controller(Controllayer),控制器,也即是视图层和模型层桥梁,控制数据的流向,承受视图层发出的事情,偏重绘视图MVC结构的一种实现模型模型二(Servlet-centric):JSP+Servlet+JavaBean,以控制为核心,JSP只负责显示和搜集数据,Sevlet,连接视图和模型,将视图层数据,发送给模型层,JavaBean,分为业务类和数据实体,业务类管理业务数据,数据实体,承载数据,基本上大多数的项目都是使用这种MVC的实现方式。StrutsMVC结构(Webapplicationframeworks)Struts是使用MVC的实现方式二来实现的,也即是以控制器为核心。Struts提供了一些组件使用MVC开发使用程序:Model:Struts没有提供model类。这个商业逻辑必须由Web使用程序的开发者以JavaBean或EJB的方式提供View:Struts提供了actionform创建formbean,关于在controller和view间传输数据。此外,Struts提供了自定义JSP标签库,辅佐开发者用JSP创建交互式的以表单为基础的使用程序,使用程序资源文件保留了一些文本常量和错误消息,可转变为其它言语,可关于JSP中。Controller:Struts提供了一个核心的控制器ActionServlet,通过这个核心的控制器来调用其他用户注册了的自定义的控制器Action,自定义Action需要契合Struts的自定义Action标准,还需要在struts-config.xml的特定配置文件中进行配置,接收JSP输入字段形成Actionform,然后调用一个Action控制器。Action控制器中提供了model的逻辑接口。
部分面试题答案.doc

(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)

[下载]16020474985.rar




上一篇:C++ 6.0
下一篇:java 设计模式