Thursday, November 3, 2011

Web Deployment with WAR files..

Deployments tend to be easy.
But when it comes to web deployments, a Deployer faces a diversion from the usual routine.The below post is about web deployments regarding a WAR file.

What is a WAR file???

A WAR file , also known as a Web application ARchive file, is a JAR file used to distribute a collection of JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a web application.

When you take a WAR file, it is usually large in size and you find various files and directories within.
The WEB-INF directory in the WAR file contains a file names web.xml which defines the structure of the web application. If the web application is only serving JSP files, the web.xml is not strictly necessary.
If the web application uses servlets, then the servlet container uses web.xml to ascertain to which servlet  a URL request is t be routed.
web.xml is also used to define context variables which can be referenced within the servlets and it is used to define environmental dependencies which the Deployer is expected to set up.

Advantages of a WAR file :
  • SECURITY - No one can modify the deployment , once the war file is signed and deployed.
  • Easy development, testing and deployment.
  • The version of the deployed application is easily identified.
  • All J2EE container support .WAR files.
Now let us peek in to a very informative video on how to create a simple JSF application .WAR file for deployment.
(This task is usually done by the developer)

No comments:

Post a Comment