参考:
http://dawanghai.iteye.com/blog/663927
What is the difference between an application server and a Web server?
Taking a big step back, a Web server serves pages for viewing in a Web browser, while an application server provides methods that client applications can call. A little more precisely, you can say that:
A Web server exclusively handles HTTP requests, whereas an application server serves business logic to application programs through any number of protocols.
Let's examine each in more detail.
The Web server
A Web server handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.
Understand that a Web server's delegation model is fairly simple. When a request comes into the Web server, the Web server simply passes the request to the program best able to handle it. The Web server doesn't provide any functionality beyond simply providing an environment in which the server-side program can execute and pass back the generated responses. The server-side program usually provides for itself such functions as transaction processing, database connectivity, and messaging.
While a Web server may not itself support transactions or database connection pooling, it may employ various strategies for fault tolerance and scalability such as load balancing, caching, and clustering—features oftentimes erroneously assigned as features reserved only for application servers.
The application server
As for the application server, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object (or a function in the procedural world).
Such application server clients can include GUIs (graphical user interface) running on a PC, a Web server, or even other application servers. The information traveling back and forth between an application server and its client is not restricted to simple display markup. Instead, the information is program logic. Since the logic takes the form of data and method calls and not static HTML, the client can employ the exposed business logic however it wants.
In most cases, the server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on J2EE (Java 2 Platform, Enterprise Edition) application servers. Moreover, the application server manages its own resources. Such gate-keeping duties include security, transaction processing, resource pooling, and messaging. Like a Web server, an application server may also employ various scalability and fault-tolerance techniques.
How do Web and application servers fit into the enterprise?
An example
As an example, consider an online store that provides real-time pricing and availability information. Most likely, the site will provide a form with which you can choose a product. When you submit your query, the site performs a lookup and returns the results embedded within an HTML page. The site may implement this functionality in numerous ways. I'll show you one scenario that doesn't use an application server and another that does. Seeing how these scenarios differ will help you to see the application server's function.
Scenario 1: Web server without an application server
In the first scenario, a Web server alone provides the online store's functionality. The Web server takes your request, then passes it to a server-side program able to handle the request. The server-side program looks up the pricing information from a database or a flat file. Once retrieved, the server-side program uses the information to formulate the HTML response, then the Web server sends it back to your Web browser.
To summarize, a Web server simply processes HTTP requests by responding with HTML pages.
Scenario 2: Web server with an application server
Scenario 2 resembles Scenario 1 in that the Web server still delegates the response generation to a script. However, you can now put the business logic for the pricing lookup onto an application server. With that change, instead of the script knowing how to look up the data and formulate a response, the script can simply call the application server's lookup service. The script can then use the service's result when the script generates its HTML response.
In this scenario, the application server serves the business logic for looking up a product's pricing information. That functionality doesn't say anything about display or how the client must use the information. Instead, the client and application server send data back and forth. When a client calls the application server's lookup service, the service simply looks up the information and returns it to the client.
By separating the pricing logic from the HTML response-generating code, the pricing logic becomes far more reusable between applications. A second client, such as a cash register, could also call the same service as a clerk checks out a customer. In contrast, in Scenario 1 the pricing lookup service is not reusable because the information is embedded within the HTML page. To summarize, in Scenario 2's model, the Web server handles HTTP requests by replying with an HTML page while the application server serves application logic by processing pricing and availability requests.
Caveats
Recently, XML Web services have blurred the line between application servers and Web servers. By passing an XML payload to a Web server, the Web server can now process the data and respond much as application servers have in the past.
Additionally, most application servers also contain a Web server, meaning you can consider a Web server a subset of an application server. While application servers contain Web server functionality, developers rarely deploy application servers in that capacity. Instead, when needed, they often deploy standalone Web servers in tandem with application servers. Such a separation of functionality aids performance (simple Web requests won't impact application server performance), deployment configuration (dedicated Web servers, clustering, and so on), and allows for best-of-breed product selection.
Tomcat Tomcat严格意义上并不是一个真正的App Server,它只是一个可以支持运行Serlvet/JSP的 Web容器,不过Tomcat也扩展了一些App Server的功能,如JNDI,数据库连接池,用户事务 处理等等。
web服务器:Tomcat
应用服务器:IBM Websphere,BEA WebLogic,RedHat JBoss
分享到:
相关推荐
WEB服务器与应用服务器的区别 1.WEB服务器: 理解WEB服务器,首先你要理解什么是WEB?WEB你可以简单理解为你所看到的HTML页面就是 WEB的数据元素,处理这些数据元素的应用软件就叫WEB服务器,如IIS、apache。 WEB服务器...
Web服务器与应用服务器配置(Apache+Tomcat&PHP).pdf
WEB服务器、应用程序服务器、HTTP服务器区别
Web服务器与Web应用服务器的区别,详细讲解WebServer与WebApplicationServer区别
详细介绍web服务器与应用程序服务器及这两种服务器的相同和区别
web服务器和应用服务器全文共6页,当前为第1页。web服务器和应用服务器全文共6页,当前为第1页。WEB服务器和使用服务器的区别: web服务器和应用服务器全文共6页,当前为第1页。 web服务器和应用服务器全文共6页,...
Explained in detail qt how to build a web server
WEB服务器和应用服务器之间的区别.doc!!!!!!!!!!!!!!
Web服务器配置与应用 Web服务器配置与应用全文共134页,当前为第1页。 内容 1 Web服务基本概念 2 Apache服务器 3 Apache图形配置工具 4 Apache的配置文件 Web服务器配置与应用全文共134页,当前为第2页。 Web服务...
对常见的WEB服务器和应用服务器的介绍 在UNIX和LINUX平台下使用最广泛的免费HTTP服务器是W3C、NCSA和APACHE服务器,而 Windows平台NT/2000/2003使用IIS的WEB服务器。 在选择使用WEB服务器应考虑的本身特性因素有:...
web服务器和应用服务器.pdf
像做Web应用系统一样做易语言程序,是一种什么样的feel?。用html写窗口UI,然后用Ajax交互数据。把web应用搬到窗口程序中,不是梦。不需要IIS、Apache之类的东西就可以使用。做漂亮的程序不是梦。声明:因为程序只是...
Web服务器和应用服务器的区别
二、Tomcat与Web服务器 j2ee应用服务器和web服务器解析全文共2页,当前为第1页。Tomcat是提供一个支持Servlet和JSP运行的容器。Servlet和JSP能根据实时需要,产生动态网页内容。而对于Web服务器来说,Apache仅仅...
应用服务器的搭建--创建Web服务器
嵌入式WEB服务器及远程测控应用详解V0.1
11、高性能Web服务器Nginx的配置与部署研究(11)应用模块之Memcached模块的两大应用场景 内容:以Nginx中的Memcached模块的使用的两大场景为例,展现Memcached模块的使用特点。 12、高性能Web服务器Nginx的配置与...
Java Web服务器(应用服务器)-java web应用程序的服务器平台审核.docx