Which package can be used for storing helper and utility classes of a Java EE web application?
A. under the document root directory of the web application.
B. WEB-INF/classes
C. WEB-INF
D. WEB-INF/lib
E. The same directory where the WAR file is placed.
Given answer is B.
Any loose classes such as servlet classes or utility classes should be placed in /WEB-INF/classes/ directory. Hence choice B is correct.
Choice A is incorrect as anything under document root directory is 'served' to the client.
Choice C is incorrect as only the dd goes here. Any classes deployed here will not be available to the application class loader.
Choice D is incorrect as WEB-INF/lib should be used for deploying jar files.
Choice E is incorrect as the deployment system considers only the WAR file for deploying and does not consider any unpacked classes placed in the same directory.
I think the answer can also be D if the utility classes are in jar.