菜单
  

    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. JSP英文文献和中文翻译

  2. JSP技术简介及特点英文文献和中文翻译

  3. JSP技术概述英文文献和中文翻译

  4. Servlet和JSP技术概述英文文献和中文翻译

  5. 冷弯钢门户框架的设计方...

  6. 耦合侧向扭转频率的不对...

  7. 斜屋顶钢框架结构的弹性...

  8. 杂拟谷盗体内共生菌沃尔...

  9. java+mysql车辆管理系统的设计+源代码

  10. 十二层带中心支撑钢结构...

  11. 酸性水汽提装置总汽提塔设计+CAD图纸

  12. 电站锅炉暖风器设计任务书

  13. 河岸冲刷和泥沙淤积的监测国内外研究现状

  14. 当代大学生慈善意识研究+文献综述

  15. 大众媒体对公共政策制定的影响

  16. 乳业同业并购式全产业链...

  17. 中考体育项目与体育教学合理结合的研究

  

About

751论文网手机版...

主页:http://www.751com.cn

关闭返回