菜单
  

    3 JavaServer Pages:
    While Java servlets are a big step up from CGI programs, they are not a panacea. To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like: out.println("<P>One line of HTML.</P>"); out.println("<P>Another line of HTML.</P>"); is all too common in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more complex, Java developers end up being cast into the role of HTML page designers.
    Meanwhile, given the choice, most project managers prefer to pide development teams into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with business logic, making it difficult for team members to specialize.
    To solve this problem, Sun turned to the idea of using server pages to combine scripting and templating technologies into a single component. To build Java Server Pages, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting elements are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP pages by looking for code that begins with <% and ends with %>.
    To be seen as a JSP page, the file just needs to be saved with an extension of .jsp. When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and compiles the source into a Java class file—just as you would do if you were writing a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file. If the JSP file has changed since it was last compiled, the container will retranslate and rebuild the page all over again.
    Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to complete the business-logic portion. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP
    原文的翻译
    JSP技术和JSP应用程序框架的概述
    1、    jsp的优点
    JSP被转换成servlet。所以,基本上,这个jsp可以完成任何任务,当然也可以通过servlet来完成。但是,这个所谓的等价并不表明servlet和JSP页面也同样适用于所有方面。这个问题不是技术所能解决的。这是方便,效率和可文护性的一个或另一个。毕竟,每一个特定的电脑上可以做平台的Java编程语言同时也能用汇编语言。然而,它仍然是非常重要的。你选择在servlet上独自运用JSP有下面好处:论文网
    更易于编写和完善HTML。HTML不是动态的:木有过剩的反斜杠和双引号,没有潜在的Java。
  1. 上一篇:门诊预约系统英文文献和中文翻译
  2. 下一篇:SQL Server数据库英文文献和中文翻译
  1. 汽车内燃机连杆载荷和应...

  2. 机械手系统英文文献和中文翻译

  3. 固体氧化物燃料电池英文文献和中文翻译

  4. 船舶运动仿真系统英文文献和中文翻译

  5. 新能源空调系统设计英文文献和中文翻译

  6. 正交试验回归法和响应曲...

  7. 机械设计制造及其自动化英文文献和中文翻译

  8. 高警觉工作人群的元情绪...

  9. NFC协议物理层的软件实现+文献综述

  10. 浅析中国古代宗法制度

  11. g-C3N4光催化剂的制备和光催化性能研究

  12. 中国传统元素在游戏角色...

  13. 巴金《激流三部曲》高觉新的悲剧命运

  14. C++最短路径算法研究和程序设计

  15. 上市公司股权结构对经营绩效的影响研究

  16. 江苏省某高中学生体质现状的调查研究

  17. 现代简约美式风格在室内家装中的运用

  

About

优尔论文网手机版...

主页:http://www.youerw.com

关闭返回