Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create WAR files

 
Sreedhar mar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hava no idea about WAR files.How to create WAR files .What are the files or directorys need to crate it.
 
Manish Hatwalne
Ranch Hand
Posts: 2595
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this link, it explains WAR quite well -
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WCC3.html
- Manish
 
Gayathri Prasad
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
You need to have RI to see some code in action for link given by Manish.Its lot better to have RI and check for urself some code in action.So if u dont have the RI download it from the Sun site.WAR stands for Web ARchive and essentially this is very similar to JAR but when we pack together the web components, the WAR is an appropriate term .
Cheers,
Gaya3

----------------
Prasanna Kumar R.V
 
Tina Williams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by RI?
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tina Williams:
What do you mean by RI?

J2EE Reference Implementation.
This comes along with Sun J2EE SDK
 
Jithesh Kozhipurath
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
War stands for web archive. U can copy the file to ur web server root directory. so that it will extract automatically to the root folder and u can simply rum that from there.
But What is this RI?
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all...
This confusion about RI...well Sun has 2 containers to run J2EE application
1. J2EE Reference Implementation(J2EE RI)
2. Sun One Application Server(SoAS)
J2EE RI
This one is for pc's having <128MB RAM on Win 2k or Win98,Win Me.
J2EE RI

SoAS
This is for systems running Win2k with >128 MB RAM.
SoAS
Copy of J2EE SDK
hth
MB
[ September 17, 2003: Message edited by: Malhar Barai ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what Gayathri is taking about: you do not need any implementation of J2EE in order to create a war file.
You can create it by hand using any zip tool as long as you make sure that the folder structure within the zip file follows the war file format.
The best way that I've found to create them (as well as manage all other build operations) is using Apache Ant.
Now, when it comes time to deploy the war file, of course you need a Servlet/JSP engine. Any spec-compliant engine will do (I favor Jakarta Tomcat and Caucho Resin myself).
hth,
bear
[ September 17, 2003: Message edited by: Bear Bibeault ]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if you want to learn about how to use Ant to make deployable war files you might consider reading my recent series of articles on making web applications in the Java Ranch Newsletter.
 
ramdas pradeep kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've installed apache-ant.
while executing ant command i got:
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Bad command or file name
please help
 
Jason Davies
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A .war file simply contains your web application structure.
You should have a directory something like this:
index.html
...
WEB-INF/
WEB-INF/web.xml
WEB-INF/classes/
WEB-INF/classes/Foo.class
...
Then create the .war file using
Read the tutorial links mentioned above for more detail, but the basics are pretty simple.
 
ramdas pradeep kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is ant is a tool for creating war files?
will ant create xml,web-inf... all these atomatically.?
 
Jason Davies
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant is a Java build tool, similar to make. Ant can be used to create WAR files, only if you have the correct entries in the Ant build.xml configuration file.
In fact you can just use the jar task in one of your targets like this:

The directory structures can also be automatically created. Perhaps you would use something like the following:

Ant is very powerful and can be used for all sorts of things to save you time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic