Pages

Monday, November 9, 2009

Difference between Web Server and Application Server

Application server vs Web server

Web Server:
  • Handles only HTTP protocol
  • Consists of web container alone (Servlet/JSP)
  • Code has take care of security, transaction, database connectivity and messaging

Application Server:
  • Handles Multiple protocol
  • Contains web container + EJB container
  • Application server itself will take care of security, transaction, database connectivity, pooled data connections, data caches, session persistence, messaging and fail over protection

Explained more at
1) http://www.javaworld.com/javaqa/2002-08/01-qa-0823-appvswebserver.html?page=1
2) http://www.serverwatch.com/tutorials/article.php/10825_1355131_1/Web-Servers-vs-App-Servers-Choosing-Between-the-Two.htm

Difference Between JAR, WAR and EAR files

All these JAR, WAR and EAR files can be created using JAR tool.

JAR (Java ARchive) contains
  • Library Class files
  • Resource files
  • Property files

WAR (Web ARchive) contains
  • JAR files (lib)
  • Java Class files (classes)
  • JSP, HTML, JS, CSS and image files
  • Deployment Descriptor (web.xml) and other configuration XML files
It is also called as Web Module.

EAR (Enterprise ARchive) contains
  • WAR files
  • JAR files
  • Enterprise Java Beans
  • Application Deployment Descriptor (application.xml) and other configuration XML files

EAR contains the complete enterprise application which consists of one or more web modules.

Note: Tomcat deals only with WAR files. If you want to install EAR files, use Apache Geronimo

For more details, refer http://www.javaworld.com/javaworld/jw-01-2008/jw-01-tomcat6.html?page=2