Search your topic in Java2share
Home > SCWCD > SCWCD Question Bank
eXTReMe Tracker

2. The Structure and Deployment of Web Applications (SCWCD)

1. Construct the file and directory structure of a Web Application that may contain (a) static content, (b) JSP pages, (c) servlet classes, (d) the deployment descriptor, (e) tag libraries, (d) JAR files, and (e) Java class files; and describe how to protect resource files from HTTP access.
2. Describe the purpose and semantics of the deployment descriptor.
3. Construct the correct structure of the deployment descriptor.

  1. Explain the purpose of a WAR file and describe the contents of a WAR file, how one may be constructed

Q1 Which three are valid URL mappings to a servlet in a web deployment
descriptor? (Choose three.)

A. */*                                             B. *.do
C. MyServlet                                   D. /MyServlet
E. /MyServlet/*                             F. MyServlet/*.jsp

Answer: B, D, E

Q2. Click the Task button.
Place the appropriate element names on the left on the web application deployment descriptor on the right so that files ending in ".mpg" are associated with the MIME type "video/mpeg."


Q3. Which three web application deployment descriptor elements allow webcomponents to gain references to resources or EJB components? (Choose three.)

A. ejb-ref                                                    B. jdbc-ref
C. servlet-ref                                               D. resource-ref
E. javamail-ref                                            F. ejb-remote-ref
G. resource-env-ref

Answer: A, D, G

Q4. Which two actions protect a resource file from direct HTTP access within a web application? (Choose two.)

A. placing it in the /secure directory
B. placing it in the /WEB-INF directory
C. placing it in the /META-INF/secure directory
D. creating a <web-resource> element within the deployment descriptor
E. creating a <secure-resource> element within the deployment descriptor

Answer: B, C