You have created a valid directory structure and a valid WAR file for your Java EE web application. Given that:
-ValidApp.war is the name of of the WAR file
-WARdir represents the directory that must exist in every WAR file.
-APPdir represents the directory that must exist in every web application.
Which is true?
A. The actual name of WARdir is NOT predictable.
B. The name of your application is NOT predictable.
C. In this directory structure, APPdir will exist inside WARdir.
D. In this directory structure, the application's deployment descriptor will reside in the same directory as WARdir.
E. Placing your application in a WAR file providers the option for the container to perform additional runtime checks not otherwise guranteed.
Regarding to option A, the explanation says
Option A: the directory must be called META-INF
I think the WARdir can either be META-INF or WEB-INF.
If WARdir is WEB-INF, then option D is correct.
This is a trick question about the difference between what is mandatory in a WAR-file and what is mandatory in a web-application.
When you check the Servlet 3.0 specs about the structure of the WAR-file you can see that the WARdir in this question must be the META-INF directory:
10.6 Web Application Archive File Web applications can be packaged and signed into a Web ARchive format (WAR) file using the standard Java archive tools. For example, an application for issue tracking might be distributed in an archive file called issuetrack.war. When packaged into such a form, a META-INF directory will be present which contains information useful to Java archive tools.
posted 4 years ago
Hi, Frits. Thanks for the note.
But in a war file, there must be a WEB-INF and META-INF directories.
And the WEB-INF directory actually contains the most important files like those servlet Java classes, tag files, web.xml and etc.