File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Webserver Vs Application Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Webserver Vs Application Server" Watch "Webserver Vs Application Server" New topic
Author

Webserver Vs Application Server

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi, In general, WebServer is used for Static content like HTML, images etc..And Application Server is used for enterprise services like EJB, JAXB, JMS etc..

Question 1: Do we keep Servlet and/or JSP files in WebServer or Application Server.
Question 2: Do we deploy.war file in WebServer and .ear file in Application Server ? If so, How do they communicate ?


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60998
    
  65

There is no real definitive definition for what these terms mean. As this is a subject that has been previously discussed many times, I recommend that you search for the previous conversations on this topic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I wont call JAXB an enterprise service and JMS can be used without an application server.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

1) Either
2) If you are deploying to an app server, everything gets deployed as an ear. The app server runs in multiple containers if needed.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Khirod Patra
Greenhorn

Joined: Mar 27, 2008
Posts: 23
for JSP and Servlet it must required a Servlet container like tomcat. Web Server is only to receive the request from the client through httpd and webserver core used to communicate to different modules for further process of the request. here tomcat is a mudule/container which is responsible for handling to the servlet/jsp type of request.

An Application server has inbuild all those thing with a webserver.So if you send a servlet request to a webserver which does not have any servlet container then your request will be fail. example Apache webserver and Apache Tomcat is two different type server , in Apache Tomcat has both web server and servlet container where as in Apache webserver has not any Tomcat OR servlet container. In this case you need to configure Tomcat with Apache webserver externally.
bharat b narang
Greenhorn

Joined: Feb 16, 2011
Posts: 1
Question 1: Do we keep Servlet and/or JSP files in WebServer or Application Server
Application container has seperate Web and application container within. We usually keep Servlet / JSP in web container part of Application Server.
Many a times, we keep html and static images/files on Apache Server. Apache Server will pass the request to Application container if it si for dynamic content like jsp/servlet.

Question 2: Do we deploy.war file in WebServer and .ear file in Application Server ? If so, How do they communicate ?
We usually bundle our application as EAR if this has some application container component like ejb in it.
In that case, EAR contains, EJB jar / other files and JSP/Servlet WAR. All my WAR related stuff gets deployed on web server and EJB related stuff on Application container. If it is requeired to have communication between Web Server to Application Server, we shall need to call those services explicitly.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60998
    
  65

bharat b narang wrote:Question 1: Do we keep Servlet and/or JSP files in WebServer or Application Server
Application container has seperate Web and application container within. We usually keep Servlet / JSP in web container part of Application Server.
Many a times, we keep html and static images/files on Apache Server. Apache Server will pass the request to Application container if it si for dynamic content like jsp/servlet.

Again, it all depends upon the definition of these terms, for which there is no definitive definitions.

While Tomcat (or other servlet containers) can be fronted with a static web server such as Apache, this is not necessary unless there's something that is needed from Apache that can't be done by Tomcat.

Question 2: Do we deploy.war file in WebServer and .ear file in Application Server ? If so, How do they communicate ?
We usually bundle our application as EAR if this has some application container component like ejb in it.
In that case, EAR contains, EJB jar / other files and JSP/Servlet WAR. All my WAR related stuff gets deployed on web server and EJB related stuff on Application container. If it is requeired to have communication between Web Server to Application Server, we shall need to call those services explicitly.

Again, subject to definition. Is Tomcat an application server or a web server? Is it both? Saying something like ear == app server, and war == web server isn't accurate. What would Apache Web Server, clearly a web server, do with a war file?
shiva pandey
Greenhorn

Joined: Jan 24, 2011
Posts: 10
In a easy language

Webserver can execute only web applications i,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web applications

Application server can execute Enterprise application, i,e (servlets, jsps, and EJBs) it is having two containers

1. Web Container(for interpreting/executing servlets and jsps)
2. EJB container(for executing EJBs). it can perform operations like load balancing , transaction demarcation etc etc
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60998
    
  65

shiva pandey wrote:
Webserver can execute only web applications i,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web applications

That doesn't work. This definition means that Apache Web Server, and IIS, are not web servers. Really?

As I said, this has been debated before and without resolution. And we can come up with whatever definitions we want here, but it won't make any difference outside of this topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webserver Vs Application Server