This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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?
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”).
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.