菜单
  

    A framework is a reusable, semi-complete application that can be specialized to produce custom applications. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products.49586

    Common Gateway Interface (CGI):

    The first widely used standard for producing dynamic content was the Common Gateway Interface (CGI). CGI uses standard operating system features, such as environment variables and standard input and output, to create a bridge, or gateway, between the web server and other applications on the host machine. The other applications can look at the request sent to them by the web server and create a customized response.

    When a web server receives a request that’s intended for a CGI program, it runs that program and provides the program with information from the incoming request. The CGI program runs and sends its output back to the server. The web server then relays the response to the browser.

    CGI defines a set of conventions regarding what information it will pass as environment variables and how it expects standard input and output to be used. Like HTTP, CGI is flexible and easy to implement, and a great number of CGI-aware programs have been written.

    The main drawback to CGI is that it must run a new copy of the CGI-aware program for each request. This is a relatively expensive process that can bog down high-volume sites where thousands of requests are serviced per minute. Another drawback is that CGI programs tend to be platform dependent. A CGI program written for one operating system may not run on another.

    Java servlets:

    Sun’s Java Servlet platform directly addresses the two main drawbacks of CGI programs.First, servlets offer better performance and utilization of resources than conventional CGI programs. Second, the write-once, run-anywhere nature of Java means that servlets are portable between operating systems that have a Java Virtual Machine (JVM).

    A servlet looks and feels like a miniature web server. It receives a request and renders a response. But, unlike conventional web servers, the servlet application programming interface (API) is specifically designed to help Java developers create dynamic applications.

    To give conventional web servers access to servlets, the servlets are plugged into containers. The servlet container is attached to the web server. Each servlet can declare what URL patterns it would like to handle. When a request matching a registered pattern arrives, the web server passes the request to the container, and the container invokes the servlet.

    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 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.

  1. 上一篇:饲草机英文文献和中文翻译
  2. 下一篇:摆线针轮行星传动英文文献和中文翻译
  1. JUC同步框架英文文献和中文翻译

  2. 改善重型SCR系统的应用程...

  3. MySQL和JSP的Web应用程序英文文献和中文翻译

  4. JSP的技术英文文献和中文翻译

  5. JSP应用框架英文文献中文翻译

  6. SSH框架实现的试题库管理...

  7. 塑料注射成型工艺参数优...

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

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

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

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

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

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

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

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

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

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

  

About

优尔论文网手机版...

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

关闭返回