This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes WAR file doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "WAR file doubt" Watch "WAR file doubt" New topic
Author

WAR file doubt

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
hello ranchers,

Which of the following statements is true?
Choose at least one answer.

A. A war file is an xml configuration file
B. a war file must contain a directory called META-INF
C. a war file can contain servlets but not jsp pages
D. a war file can contain servlets, jsp and other resources
E. The top directory of a war file is the document root of the application

I guess top directory of a war file is META-INF directory itself. then this directory contain the exact web-application structure.

Agree or Disagree??




Thanks <br />Poonam Agarwal SCWCD 86%
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

Poonam Agarwal wrote:I guess top directory of a war file is META-INF directory itself. then this directory contain the exact web-application structure.Agree or Disagree??


Disagree. When war file is extracted it's top (root) should be the name of the web application. META-INF is within the root directory (along with the WEB-INF and other files) of the web application.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Agree with vijitha . create a .war file and place it under webapp folder of tomcat,then start the tomcat. now you watch how the .war file extracted
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
I got it. Thanks
MalanS Subramanian
Greenhorn

Joined: Jul 09, 2005
Posts: 8
Hi Poonam,
you have highlighted options B and E as the correct answer for the question. I feel that option D should also be included, since a war file can contain JSP, Servlets and other resources like image files, static HTMLs, js files etc...

Warm Regards,
Malan
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
you have highlighted options B and E as the correct answer for the question. I feel that option D should also be included, since a war file can contain JSP, Servlets and other resources like image files, static HTMLs, js files etc...


yes malan you are right. Thanks budy
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WAR file doubt