What is the difference between application server and web server?

前端 未结 27 2182
攒了一身酷
攒了一身酷 2020-11-22 17:03

What is the difference between application server and web server?

27条回答
  •  长发绾君心
    2020-11-22 17:12

    The main difference between Web server and application server is that web server is meant to serve static pages e.g. HTML and CSS, while Application Server is responsible for generating dynamic content by executing server side code e.g. JSP, Servlet or EJB.

    Which one should i use?
    Once you know the difference between web and application server and web containers, it's easy to figure out when to use them. You need a web server like Apache HTTPD if you are serving static web pages. If you have a Java application with just JSP and Servlet to generate dynamic content then you need web containers like Tomcat or Jetty. While, if you have Java EE application using EJB, distributed transaction, messaging and other fancy features than you need a full fledged application server like JBoss, WebSphere or Oracle's WebLogic.

    Web container is a part of Web Server and the Web Server is a part of Application Server.

    Web Server is composed of web container, while Application Server is composed of web container as well as EJB container.

提交回复
热议问题