毕业论文

打赏
当前位置: 毕业论文 > 外文文献翻译 >

Struts MVC一种开放源码英文文献和中文翻译

时间:2019-09-25 19:29来源:毕业论文
Struts an open-source MVC implementation This paper introduces Struts, a Model - View - Controller implementation that uses Servlet and JavaServer Pages (JSP) technology. Pillar changes can help you control the Web project and promote specia

Struts an open-source MVC implementation This paper introduces Struts, a Model - View - Controller implementation that uses Servlet and JavaServer Pages (JSP) technology. Pillar changes can help you control the Web project and promote specialization. Even if you never implement a system with Struts, you might get some ideas for your future servlet and JSP page implementation.39400
Model-View-Controller (MVC)
JSP tag to solve our part of the problem. We still have to verify, process control and update application state issues. This is the MVC comes in handy. MVC helps resolve some issues three types of problems and methods of single module:
Model
The model contains the core application functionality. State Model packaged applications. Sometimes it's only function is to contain state. It knew nothing about the view or controller.
View
This view provides representation of the model. It is the appearance of the application. Model-view access to read, but do not know makers. In addition, it knew nothing about the controller. It occurs when the view changes to the model should be notified.
Controller
The controller is responsive to user input. It creates and sets the model.
MVC Model 2
In the Web brought some unique challenges to software developers, most notably in the absence of state between client and server. This stateless behavior makes it difficult to change the model notify the view. When the web browser must be re-query the server to discover modification of the application state.
Another notable change is that the use of different techniques to achieve the model or controller. Of course, we can use Java (or PERL, C / C ++ or what ever) code to generate HTML. There are several disadvantages to this method:

       1.Java programmers should develop services, not HTML.
2.The need to change the code to change the layout.The need to change the code to change the layout.
Customer service should be able to create pages to meet their specific needs. 源¥自%六:维;论-文'网=www.lwfree.cn
3.The page designer isn't able to have direct involvement in page development.
4.HTML embedded into code is ugly.
For the Web, the classical form of MVC needs to be changed. Figure 4 shows the network adaptability MVC, also commonly known as MVC Model 2 or MVC 2.
Struts, an MVC 2 implementation
Struts is a set of class collaboration, servlet, and JSP tags, make a reusable MVC 2 design. This definition implies that Struts is a framework, not a library, but Struts also contains a separate frame work of a wide range of tag libraries and utility classes.
Struts overview
•    Client browser
An HTTP request from the client browser creates an event. The Web container will respond with an HTTP response.
•    Controller
The Controller receives the request from the browser, and makes the decision where to send the request. With Struts, the Controller is a command design pattern implemented as a servlet. The struts-config.xml file configures the Controller.
•    Business logic
The business logic updates the state of the model and helps control the flow of the application. With Struts this is done with an Action class as a thin wrapper to the actual business logic.
•    Model state
The model represents the state of the application. The business objects update the application state. ActionForm bean represents the Model state at a session or request level, and not at a persistent level. The JSP file reads information from the ActionForm bean using JSP tags.
•    View
The view is simply a JSP file. There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity.
Struts pros
•    Use of JSP tag mechanism
The tag feature promotes reusable code and abstracts Java code from the JSP file. This feature allows nice integration into JSP-based development tools that allow authoring with tags. Struts MVC一种开放源码英文文献和中文翻译:http://www.lwfree.cn/fanyi/20190925/39813.html
------分隔线----------------------------
推荐内容