純servlet:重新考慮視圖 外文文獻譯文和原文.doc
約22頁DOC格式手機打開展開
純servlet:重新考慮視圖 外文文獻譯文和原文,純servlet:重新考慮視圖對于具有動態(tài)內(nèi)容的web頁面,可以使用java™server pages(jsp)技術(shù)將開發(fā)人員和ui設(shè)計人員的工作分離開來。遺憾的是,jsp對于許多設(shè)計人員來說太復(fù)雜了,所以java開發(fā)人員只好自己處理jsp代碼,這往往會產(chǎn)生令人不滿意的結(jié)果。本文演示一種非正統(tǒng)的替代方法:通...


內(nèi)容介紹
此文檔由會員 wanli1988go 發(fā)布
純servlet:重新考慮視圖
對于具有動態(tài)內(nèi)容的Web頁面,可以使用Java™Server Pages(JSP)技術(shù)將開發(fā)人員和UI設(shè)計人員的工作分離開來。遺憾的是,JSP對于許多設(shè)計人員來說太復(fù)雜了,所以Java開發(fā)人員只好自己處理JSP代碼,這往往會產(chǎn)生令人不滿意的結(jié)果。本文演示一種非正統(tǒng)的替代方法:通過使用簡單的helper對象,根據(jù)純servlet構(gòu)建Web界面。
設(shè)計JSP的目的是將Web開發(fā)人員的任務(wù)與設(shè)計動態(tài)頁面UI的非開發(fā)人員的任務(wù)分離開來。遺憾的是,JSP對于許多設(shè)計人員來說太復(fù)雜了,為解決各種動態(tài)內(nèi)容問題添加的軟件層讓他們覺得非常棘手。(例如,國際化要求將文本存儲在其他地方并通過鍵來引用。)所以對于大多數(shù)項目,Java開發(fā)人員只好自己處理JSP代碼,這常常會包含本屬于設(shè)計人員的工作,使他們的精力消耗在標(biāo)記庫和其他東西上,無法集中于Java代碼。
與正統(tǒng)的方式不同,可以使用簡單的helper對象,根據(jù)常規(guī)servlet構(gòu)建簡潔優(yōu)美的 Web 界面。本文講解如何以標(biāo)準(zhǔn)的Java形式編寫動態(tài)Web頁面的視圖輸出。我將解釋這種方法的好處,并用一個計分應(yīng)用程序演示這種方法,這個程序管理一個NCAA三月狂熱獎金池。
HTML 是動態(tài)的
這種純servlet 方法非常簡單。它涉及一個 servlet 基類和一個定制的寫出器對象,servlet 子類使用這個對象產(chǎn)生輸出。代碼很簡潔,因為大多數(shù) HTML 封裝在helper對象的方法中,都可以按需重寫。代碼重用總是令人愉快,而且大多數(shù) Web 站點的頁面共享許多HTML,所以重用應(yīng)該是個重要的考慮因素。HTML 輸出方法產(chǎn)生直觀緊湊的servlet 代碼,因此可維護性很高,這使代碼的維護成本差不多直接與代碼規(guī)模成正比。通過將JSP界面重寫成純servlet,可以將代碼縮減三分之二。
Pure servlets: Rethink the view
For Web pages with dynamic content, Java™Server Pages (JSP) technology is touted as a means of separating the developer's concerns from those of the UI designer. Unfortunately, JSP is too complex for many designers, so Java developers tend to handle the JSP code themselves, often with unsatisfactory results. This article demonstrates the advantages of an unorthodox alternative: using simple helper objects to build a Web interface based on servlets alone.
This technique is not recommended for teams with designated template designers. It's intended for Java Web developers who write and maintain their own HTML output code.
JSP was designed to keep Web developers' tasks separate from those of the nondevelopers who design dynamic pages' UIs. Unfortunately, JSP is a bit too complicated for many designers, with layer upon layer added to solve the multifarious problems of dynamic content. (Internationalization, for example, requires that text be stored elsewhere and referenced by keys.) So Java developers handle the JSP code for most projects themselves, often rewriting designers' work and entangling it with taglibs and other devices to avoid entangling it with Java code.
對于具有動態(tài)內(nèi)容的Web頁面,可以使用Java™Server Pages(JSP)技術(shù)將開發(fā)人員和UI設(shè)計人員的工作分離開來。遺憾的是,JSP對于許多設(shè)計人員來說太復(fù)雜了,所以Java開發(fā)人員只好自己處理JSP代碼,這往往會產(chǎn)生令人不滿意的結(jié)果。本文演示一種非正統(tǒng)的替代方法:通過使用簡單的helper對象,根據(jù)純servlet構(gòu)建Web界面。
設(shè)計JSP的目的是將Web開發(fā)人員的任務(wù)與設(shè)計動態(tài)頁面UI的非開發(fā)人員的任務(wù)分離開來。遺憾的是,JSP對于許多設(shè)計人員來說太復(fù)雜了,為解決各種動態(tài)內(nèi)容問題添加的軟件層讓他們覺得非常棘手。(例如,國際化要求將文本存儲在其他地方并通過鍵來引用。)所以對于大多數(shù)項目,Java開發(fā)人員只好自己處理JSP代碼,這常常會包含本屬于設(shè)計人員的工作,使他們的精力消耗在標(biāo)記庫和其他東西上,無法集中于Java代碼。
與正統(tǒng)的方式不同,可以使用簡單的helper對象,根據(jù)常規(guī)servlet構(gòu)建簡潔優(yōu)美的 Web 界面。本文講解如何以標(biāo)準(zhǔn)的Java形式編寫動態(tài)Web頁面的視圖輸出。我將解釋這種方法的好處,并用一個計分應(yīng)用程序演示這種方法,這個程序管理一個NCAA三月狂熱獎金池。
HTML 是動態(tài)的
這種純servlet 方法非常簡單。它涉及一個 servlet 基類和一個定制的寫出器對象,servlet 子類使用這個對象產(chǎn)生輸出。代碼很簡潔,因為大多數(shù) HTML 封裝在helper對象的方法中,都可以按需重寫。代碼重用總是令人愉快,而且大多數(shù) Web 站點的頁面共享許多HTML,所以重用應(yīng)該是個重要的考慮因素。HTML 輸出方法產(chǎn)生直觀緊湊的servlet 代碼,因此可維護性很高,這使代碼的維護成本差不多直接與代碼規(guī)模成正比。通過將JSP界面重寫成純servlet,可以將代碼縮減三分之二。
Pure servlets: Rethink the view
For Web pages with dynamic content, Java™Server Pages (JSP) technology is touted as a means of separating the developer's concerns from those of the UI designer. Unfortunately, JSP is too complex for many designers, so Java developers tend to handle the JSP code themselves, often with unsatisfactory results. This article demonstrates the advantages of an unorthodox alternative: using simple helper objects to build a Web interface based on servlets alone.
This technique is not recommended for teams with designated template designers. It's intended for Java Web developers who write and maintain their own HTML output code.
JSP was designed to keep Web developers' tasks separate from those of the nondevelopers who design dynamic pages' UIs. Unfortunately, JSP is a bit too complicated for many designers, with layer upon layer added to solve the multifarious problems of dynamic content. (Internationalization, for example, requires that text be stored elsewhere and referenced by keys.) So Java developers handle the JSP code for most projects themselves, often rewriting designers' work and entangling it with taglibs and other devices to avoid entangling it with Java code.
TA們正在看...
- 論刑事訴訟法的再修改-----畢業(yè)設(shè)計.doc
- 論刑事訴訟非法證據(jù)排除規(guī)則---本科畢業(yè)論文.doc
- 論刑事訴訟中財產(chǎn)權(quán)的保障------畢業(yè)設(shè)計.doc
- 論行政管理論文.doc
- 論行政決定的效力形態(tài).doc
- 論行政司法行為------畢業(yè)設(shè)計.doc
- 論行政自由裁量權(quán)的司法監(jiān)督----畢業(yè)設(shè)計.doc
- 論行政自由裁量權(quán)及其監(jiān)督------畢業(yè)設(shè)計.doc
- 論亞里士多德的政體觀-----畢業(yè)論文.doc
- 論藥妝在中國的發(fā)展.doc