Creating war file is a simple if you use an IDE when you are programming in J2EE applications.
Now Let's see how to create this war component using command prompt.
1. First create a folder in a directory you wish to create the .war file. I named it as HelloWar.
2. Prepare these two components inside HelloWar folder.
1. WEB-INF folder
2. index.html or index.jsp
3. Inside the WEB-INF folder, place the followings.
1. lib folder
2. classes folder
3. jboss-web.xml
4. web.xml.
6. With the above command you add .war to the application folder. Again you can verify this.
Now Let's see how to create this war component using command prompt.
1. First create a folder in a directory you wish to create the .war file. I named it as HelloWar.
2. Prepare these two components inside HelloWar folder.
1. WEB-INF folder
2. index.html or index.jsp
3. Inside the WEB-INF folder, place the followings.
1. lib folder
2. classes folder
3. jboss-web.xml
4. web.xml.
Figure 1- jboss-web.xml |
Figure 2- web.xml
4. Now it's time to go :)
So first go the folder using command prompt and then you can check the folder structure of the application.
|
5. Then now we are going to create .war using jar -cvf HelloWar.war * command.
No comments:
Post a Comment