Apache Tomcat, Jetty and Sun Java System Web Server are only Java
Web (Servlet) containers,
meaning they can only execute
Servlets/JSP - they don't provide the full Java EE API stack.
There are three terminologies
1. Web server ( Apache
server) that can handle HTTP requests/response AND can parse php
like files to HTML data.
2. Web container ( Apache Tomcat)
that can only execute Servlets/JSP - they don't provide the full
Java EE API stack. Web container interacts with Java servlets
3. Application Server ( Jboss/Websphere/Weblogic etc).Every Java
EE server has a Web Container + EJB Container.
Read more: Link
Tomcat is a web server (can handle HTTP
requests/responses) and web container (implements Java Servlet
API, also called servletcontainer) in one.
Some may call it
an application server, but it is definitely not an fullfledged
Java EE application server (it does not implement the whole Java
EE API).
A specification means having a set of rules.
It has list of Interfaces.
Any JavaEE servers which needs to
comply to specification needs to have the implementation of these
interfaces.
If you are deploying your enterprise
applications (means you have JPA, EJB or some technology which is
part of Java EE) to the a server which comply to JavaEE then the
lib need not contain the API implementation jars. But these are
needed if you are using s server like tomcat for deployment.
For example, if you use JPA in your applications and deploying it
to the Jboss AS 7, then you DON'T need any additional jars in the
lib. But when you deploy to the tomcat server then you need to
have additional jars to lib that implements the JPA spec eg:
Hibernate. This is what makes JBoss AS 7 an application server
and tomcat a web server.
Another key difference is that we
can not deploy an EAR file to tomcat, it could only handle WAR
files.