freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計(jì)算機(jī)專業(yè)畢業(yè)論文外文翻譯--struts——mvc的一種開放源碼實(shí)現(xiàn)-預(yù)覽頁

2025-06-20 17:40 上一頁面

下一頁面
 

【正文】 a user interface. JavaServer Pages (JSP) technology provides the glue between the page designer and the Java developer. If you have worked on a largescale Web application, you understand the term change. ModelViewController (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Struts is an MVC implementation that uses Servlets and JSP 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. ModelViewController (MVC) JSP tags solved only part of our problem. We still have issues with validation, flow control, and updating the state of the application. This is where MVC es 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 contains the core of the application39。 ActionForm) The ActionServlet class Do you remember the days of function mappings? You would map some input event to a pointer to a function. If you where slick, you would place the configuration information into a file and load the file at run time. Function pointer arrays were the good old days of structured programming in C. Life is better now that we have Java technology, XML, J2EE, and all that. The Struts Controller is a servlet that maps events (an event generally being an HTTP post) to classes. And guess what the Controller uses a configuration file so you don_t have to hardcode the values. Life changes, but stays the same. ActionServlet is the Command part of the MVC implementation and is the core of the Framework. ActionServlet (Command) creates and uses Action, an ActionForm, and ActionForward. As mentioned earlier, the file configures the Command. During the creation of the Web project, Action and ActionForm are extended to solve the specific problem space. The file instructs ActionServlet on how to use the extended classes. There are several advantages to this approach: ? The entire logical flow of the application is in a hierarchical text file. This makes it easier to view and understand, especially with large applications. ? The page designer does not have to wade through Java code to understand the flow of the application. ? The Java developer does not need to repile code when making flow changes. Command functionality can be added by extending ActionServlet. The ActionForm class ActionForm maintains the session state for the Web application. ActionForm is an abstract class that is subclassed for each input form model. When I say input form model, I am saying ActionForm represents a general concept of data that is set or updated by a HTML form. For instance, you may have a UserActionForm that is set by an HTML Form. The Struts framework will: ? Check to see if a UserActionForm exists。盡管您可能永遠(yuǎn)不會用 Struts 實(shí)現(xiàn)一個(gè)系統(tǒng),但您可以將其中的一些思想用于您以后的 servlet 和 JSP 網(wǎng)頁的實(shí)現(xiàn)中。設(shè)計(jì)漂亮的網(wǎng)站需要做大量的工作,大多數(shù) Java 開發(fā)人員更注重創(chuàng)建優(yōu)美的對象接口,而不是用戶界面。 MVC 減弱了業(yè)務(wù)邏輯接口和數(shù)據(jù)接口之間的耦合。我們還得處理驗(yàn)證、流程控制和更新應(yīng)用程序的狀態(tài)等問題。有時(shí)它包含的唯一功能就是狀態(tài)。視圖可以訪問模型的讀方法,但不能訪問寫方法。它創(chuàng)建并設(shè)置模型。 另一個(gè)重大變化是實(shí)現(xiàn)視圖所用的技術(shù)與實(shí)現(xiàn)模型或控制器的技術(shù)不同。 ? 服務(wù)的用戶應(yīng)該能夠創(chuàng)建網(wǎng)頁來滿足它們的特定需要。圖 4 顯示了 MVC 的 Web 改寫版,通常也稱為 MVC Model 2 或 MVC 2。 圖 5. Struts 概覽 Struts 概覽 ? Client browser(客戶瀏覽器) 來自客戶瀏覽器的每個(gè) HTTP 請求創(chuàng)建一個(gè)事件。 文件配置控制器。業(yè)務(wù)對象更新應(yīng)用程序的狀態(tài)。其中沒有流程邏輯,沒有業(yè)務(wù)邏輯,也沒有模型 信息 只有標(biāo)記。 圖 6. Command (ActionServlet) 與 Model (Action amp。 現(xiàn)在好多了,我們有了 Java 技術(shù)、 XML、 J2EE,等等。 ActionServlet 是該 MVC 實(shí)現(xiàn)的 Command 部分,它是這一框架的核心。文件 指示 ActionServlet 如何使用這些擴(kuò)展的類。 ? Java 開發(fā)人員也不必在更改流程以后重新編譯代碼。當(dāng)我說 輸入表單模型 時(shí) ,是指 ActionForm 表示的是由 HTML 表單設(shè)置或更新的一般意義上的數(shù)據(jù)。沒有太多討厭的 () 調(diào)用。 注: 這并不總是明智之舉。 注: ? 文件控制 HTML 表單請求與 ActionForm 之間的映射關(guān)系。 Action 類的用途是將 HttpServletRequest 轉(zhuǎn)換為業(yè)務(wù)邏輯。當(dāng)事件進(jìn)展到這一步時(shí),輸入表單數(shù)據(jù)(或 HTML 表單數(shù)據(jù))已被從請求流中提取出來并轉(zhuǎn)移到 ActionForm 類中。 考慮 Action 類的另一種方式是 Adapter 設(shè)計(jì)模式。本例中的客戶機(jī)是 ActionServlet ,它對我們的具體業(yè)務(wù)類接口一無所知。 Action 開始為一個(gè)接口,后來卻變成了一個(gè)類。 ActionErrors 是 ActionError 類的容器, View 可以使用標(biāo)記訪問這些 類。 確定 Controller 調(diào)用哪個(gè) Action 類。這樣就使 Action 可訪問用于控制流程的信息。 ? 標(biāo)記庫 為什么要另發(fā)明 一種輪子,或標(biāo)記庫呢?如果您在庫中找不到您所要的標(biāo)記,那就自己定義吧。 ? MVC 實(shí)現(xiàn)樣例 如果您希望創(chuàng)建您自己的 MVC 實(shí)現(xiàn),則 Struts 可增加您的見識。 Struts 的缺點(diǎn) ? 仍處于發(fā)展初期 Struts 開發(fā)仍處于初級階段。為了避免使用不贊成使用的方法,您可能隔一天就需要下載最新的 Struts。在開發(fā)網(wǎng)頁的過程中,我們是否應(yīng)該讓網(wǎng)頁設(shè)計(jì)人員訪問 Java 代碼?某些框架(如 Velocity)說不應(yīng)該,但它提供了另一種 Web 開發(fā)語言讓我們學(xué)習(xí)。在 ASP 開發(fā)中,您應(yīng)該創(chuàng)建 COM 對象,然后編寫少量的 ASP 腳本將這些 COM 對象聯(lián)系起來。無論您決定使用哪種類型的框架,您都應(yīng)該了 解您要在其中部署和維護(hù)該框架的環(huán)境。僅憑這一點(diǎn)遠(yuǎn)不能解決您的全部安裝問題,除非使用 Tomcat 。毫無疑問,要理解 Struts 必須接受一定的培訓(xùn)。在不到 5 年的時(shí)間內(nèi),我已經(jīng)目睹了從 cgi/perl 到 ISAPI/NSAPI、再到使用 VB 的 ASP、一直到現(xiàn)在的 Java 和 J2EE 的變遷。
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1