• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

META-INF directory  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one question on META-INF directory.
is it mandatory (i.e by the Spec) that a WAR file must have a META-INF directory?

As far as i know, even WEB-INF folder is not a must in a web app. Am I right?

What does SCWCD expect as answer for such a question?
 
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The META-INF directory is required if you are deploying your application as a WAR file.
2. The WEB-INF directory is required in a web application...
 
padma jyotsna
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..but I am not clear yet.

As per what I have read in SCWCD exam study guide by David Bridgewater , it says

"Having a directory called WEB-INF is a strong recommendation ,but not an obligation.
If a question asks you to say whether a web application must have particular directories.The correct answer is "No"."

Hence ,I am not clear on what is the right answer? Is there an error in the above statement?
please clarify..
 
Ranch Hand
Posts: 310
1
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually the WEB-INF and JSP's comes under application root directory and it do have "classes", "lib", "tags" etc as sub directories as well as web.xml. I haven't seen any web application deployed without a WEB-INF folder. Never tried deploying a web app without WEB-INF. This is what HFS book says!

To deploy a web app successfully, you MUST follow this structure. WEB-INF must be immediately
under the application context (MyTestApp in this example). The “classes” directory must be
immediately inside “WEB-INF”. The package structure for the classes must be immediately inside
“classes”. The “lib” directory must be immediately inside “WEB-INF”, and the JAR fi le must be
immediately inside “lib”. The “META-INF” directory must be immediately inside the JAR, and TLD
fi les in a JAR must be somewhere under “META-INF” (they can be in any subdirectory, and “TLDs” is
not required as a directory name). TLDs that are NOT in a JAR must be somewhere under “WEB-
INF”. Tag Files (fi les with a .tag or .tagx extension) must be somewhere under “WEB-INF/tags”
(unless they’re deployed in a JAR, in which case they must be somewhere under “META-INF/tags”).

 
Ankit Garg
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec is unclear about whether WEB-INF is mandatory. Checkout this old thread on this...
 
Rajeev Rnair
Ranch Hand
Posts: 310
1
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ankit Garg wrote:The spec is unclear about whether WEB-INF is mandatory. Checkout this old thread on this...

Thanks Ankit! wow!! lot of information on that thread !
 
padma jyotsna
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ankit Garg wrote:The spec is unclear about whether WEB-INF is mandatory. Checkout this old thread on this...



Thanks for all the replies..
I have checked the spec and the above referred thread. There is nothing mentioned clearly about whether WEB-INF and META-INF are mandatory.

Finally is it correct to say that WEB-INF & META-INF directories must be there. Is that correct? thats what the exam expects?

But at this link ScwcdHints , point 12 is contradictory. I believe its taken from DavidBRIDGEWATER book.

 
Creator of Enthuware JWS+ V6
Bartender
Posts: 3121
259
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Padma,

Finally is it correct to say that WEB-INF & META-INF directories must be there


Not exactly, they should be there in normal circumstances, but if you leave them out the behaviour of your web-app is not guaranteed.
For the tomcat container there is no problem: the application works ok (but that doesn't guarantee the same behaviour in another container)

I am pretty sure that they won't ask such a question in an exam because the specs are not clear about it. Exam questions are based on the things that are specified.

Regards,
Frits
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!