How to create WAR file in eclipse?

What is war file?

WAR stands for Web application Archive. WAR is a compressed file format like the ZIP file which includes jsp, servlet, jar and static web resources etc in a specific hierarchical directory structure called WEB-INF. It is like jar file but follow a specific hierarchical directory structure. WAR files are deployed to the application server like Tomcat or Java EE server like JBoss etc.
Note: WAR files have the .war extension and contains the whole web application.

How to create WAR file in eclipse?

Let us discuss it with an example. We are creating a java project which contain one class The contains one static method armstrong(int num) which returns true if the num is an armstrong number otherwise returns false. We will create the JAR file of this and use JAR file in other project.

Step 1: Right click on the project and click on Export.


Step 2: Select the WAR file and click on Next.


Step 3: Enter the destination and click on Finish.


Related Topics:

How to build java project using ant in eclipse?
JAXB marshalling – convert java object to xml example.
How to create pdf file in java using iText jar?
Generics class example.
OGNL in struts 2.
Hibernate One-to-One Mapping using xml.
Send inline image in email using JavaMail API.
Quartz 2 JobListener example.


Content Protection by
Please Share