• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creation of a war file  RSS feed

 
Krishna, Alle
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a way to create a .war file as a directory as opposed to a simple file. For ex,
I like to have the war file as a directory the following way.
mywar.war
- images
- META-INF
- WEB-INF
- abc.jsp
so that I can traverse to each directory beneath it.
I know that simply creating a war by:
jar -cvf mywar.war *
will only create a file.
Thanks.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you are trying to say...
A war file is not a directory, but simply is a file. If you are trying to include contents under different directories into the warfile, you will have to explicitly mention directory names in the command -
images/* META-INF/* WEB-INF/* and so on.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Servlets forum...
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the WebServer that you are using.
Apache TomCat for example allows you to create a new directory in it's 'webapps' directory that contains all of the files for the application in a directory structure that mimics the structure of the WAR file.
This is great for testing as you can modify the JSPs etc and retest without the need to package and redeploy the WAR file. However building and generating the WAR file is the best way and shouldn't be too hard a task especially if you create a build script using ANT.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!