国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

1. Introduction

2019-11-18 11:31:32
字體:
供稿:網(wǎng)友

1. Introduction 介紹

1.1 Forward into the Past! (or a brief history of Struts)回顧過去!(Struts簡史)

When java servlets were first invented, many PRogrammers quickly realized that they were a Good Thing. They were faster and more powerful that standard CGI, portable, and infinitely extensible.
當(dāng)JavaServlets第一次出現(xiàn)時,許多程序員很快意識到那是一個好東西。比標(biāo)準(zhǔn)CGI更快速、更強(qiáng)大、輕便,可以無限擴(kuò)展。

But writing Html to send to the browser in endless println() statements was tiresome and problematic. The answer to that was JavaServer Pages, which turned Servlet writing inside-out. Now developers could easily mix HTML with Java code, and have all the advantages of servlets. The sky was the limit!
但是在向瀏覽器輸出HTML語句需要寫不斷地寫println()語句,這實(shí)在是一件令人厭倦和麻煩的事。

Java web applications quickly became "jsp-centric". This in-and-of itself was not a Bad Thing, but it did little to resolve flow control issues and other problems endemic to web applications.

Another model was clearly needed ...

Many clever developers realized that JavaServer Pages AND servlets could be used together to deploy web applications. The servlets could help with the control-flow, and the JSPs could focus on the nasty business of writing HTML. In due course, using JSPs and servlets together became known as Model 2 (meaning, presumably, that using JSPs alone was Model 1).

Of course, there is nothing new under the Sun ... and many have been quick to point out that JSP's Model 2 follows the classic Model-View-Controller design pattern abstracted from the venerable Smalltalk MVC framework. Java Web developers now tend to use the terms Model 2 and MVC interchangeably. In this guide, we use the MVC paradigm to describe the Struts architecture, which might be best termed a Model 2/MVC design.

The Struts project was launched in May 2000 by Craig R. McClanahan to provide a standard MVC framework to the Java community. In July 2001, Struts 1.0 was released, and IOHO, Java Model 2 development will never be quite the same.

1.2 The Model-View-Controller ('MVC') Design Pattern

In the MVC design pattern, application flow is mediated by a central Controller. The Controller delegates requests - in our case, HTTP requests - to an appropriate handler. The handlers are tied to a Model, and each handler acts as an adapter between the request and the Model. The Model represents, or encapsulates, an application's business logic or state. Control is usually then forwarded back through the Controller to the appropriate View. The forwarding can be determined by consulting a set of mappings, usually loaded from a database or configuration file. This provides a loose coupling between the View and Model, which can make applications significantly easier to create and maintain.

1.2.1 The Model: System State and Business Logic JavaBeans



發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 石城县| 沙洋县| 昌江| 聊城市| 仁寿县| 时尚| 合山市| 彝良县| 绥化市| 阿荣旗| 鄄城县| 白玉县| 甘泉县| 陈巴尔虎旗| 日喀则市| 德钦县| 武威市| 赫章县| 宜都市| 涞源县| 营山县| 安泽县| 桂平市| 涿州市| 兰考县| 东阿县| 蓬莱市| 河北省| 冀州市| 辽中县| 连南| 潼关县| 新干县| 宁波市| 集安市| 井陉县| 孝义市| 营口市| 高平市| 瑞昌市| 南川市|