《计算机相关外文翻译》由会员分享,可在线阅读,更多相关《计算机相关外文翻译(35页珍藏版)》请在毕设资料网上搜索。
1、 外 文 翻 译 英文题目: Infrastructure for Automatic Dynamic Deployment Of J2EE Application in Distributed Environments & Struts an open-source MVC implementation 中文 题目 : 基于 J2EE 在分布式环境下的底层结构的自动动态配置的应用 与 Struts MVC 的一种开放源码实现 外文原文 1 Struts an open-source MVC implementation Abstract: This article introduces St
2、ruts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology. Struts can help you control change in your Web project and promote specialization. Even if you never implement a system with Struts, you may get some ideas for your future servlets and JSP page imp
3、lementation. Keywords: Struts; MVC; JSP 1 Introduction Kids in grade school put HTML pages on the Internet. However, there is a monumental difference between a grade school page and a professionally developed Web site. The page designer (or HTML developer) must understand colors, the customer, produ
4、ct flow, page layout, browser compatibility, image creation, JavaScript, and more. Putting a great looking site together takes a lot of work, and most Java developers are more interested in creating a great looking object interface than a user interface. JavaServer Pages (JSP) technology provides th
5、e glue between the page designer and the Java developer. If you have worked on a large-scale Web application, you understand the term change. Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Struts is an MVC im
6、plementation that uses Servlets 2.2 and JSP 1.1 tags, from the J2EE specifications, as part of the implementation. You may never implement a system with Struts, but looking at Struts may give you some ideas on your future Servlets and JSP implementations. 2 Model-View-Controller (MVC) JSP tags solve
7、d only part of our problem. We still have issues with validation, flow control, and updating the state of the application. This is where MVC comes to the rescue. MVC helps resolve some of the issues with the single module approach by dividing the problem into three categories: Model The model contai
8、ns the core of the applications functionality. The model encapsulates the state of the application. Sometimes the only functionality it contains is state. It knows nothing about the view or controller. View The view provides the presentation of the model. It is the look of the application. The view
9、can access the model getters, but it has no knowledge of the setters. In addition, it knows nothing about the controller. The view should be notified when changes to the model occur. Controller The controller reacts to the user input. It creates and sets the model. 3 MVC Model 2 The Web brought some
10、 unique challenges to software developers, most notably the stateless connection between the client and the server. This stateless behavior made it difficult for the model to notify the view of changes. On the Web, the browser has to re-query the server to discover modification to the state of the a
11、pplication. Another noticeable change is that the view uses different technology for implementation than the model or controller. Of course, we could use Java (or PERL, C/C+ or what ever) code to generate HTML. There are several disadvantages to that approach: Java programmers should develop services, not HTML. Changes to layout would require changes to code. Customers of the service should be able to create pages to meet their specific needs. The page designer isnt able to have direct involvement in page development. HTML embedded into code is ugly.