SUN Sun Certified Web Component Developer for J2EE 5 Sample Questions:
1. DRAG DROP
Click the Task button.
Given a servlet mapped to /control, place the correct URI segment returned as a String on the corresponding HttpServletRequest method call for the URI:
/myapp/control/processorder.
2. Which JSTL code snippet can be used to import content from another web resource?
A) <c:import url="foo.jsp"/>
B) Importing cannot be done in JSTL. A standard action must be used instead.
C) <c:import page="foo.jsp"/>
D) <c:include url="foo.jsp"/>
E) <c:include page="foo.jsp"/>
3. Which statement is true about web container session management?
A) To activate URL rewriting, the developer must use the
HttpServletResponse.setURLRewriting method.
B) If the web application uses HTTPS, then the web container may use the data on the
HTTPS request stream to identify the client.
C) The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.
D) Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
4. Given the two security constraints in a deployment descriptor:
1 01. <security-constraint>
1 02. <!--a correct url-pattern and http-method goes here-->
1 03. <auth-constraint><role-name>SALES</role-name></auth-
1 03. <auth-constraint>
1 04. <role-name>SALES</role-name>
1 05. </auth-constraint>
1 06. </security-constraint>
1 07. <security-constraint>
1 08. <!--a correct url-pattern and http-method goes here-->
1 09. <!-- Insert an auth-constraint here -->
1 10. </security-constraint>
If the two security constraints have the same url-pattern and http-method, which two, inserted independently at line 109, will allow users with role names of either SALES or
MARKETING to access this resource? (Choose two.)
A) <auth-constraint>
< role-name>ANY</role-name>
< /auth-constraint>
B) <auth-constraint>
< role-name>MARKETING</role-name>
< /auth-constraint>
C) <auth-constraint>
< role-name>*</role-name>
< /auth-constraint>
D) <auth-constraint/>
5. You want to create a valid directory structure for your Java EE web application, and you want to put your web application into a WAR file called MyApp.war. Which two are true about the WAR file? (Choose two.)
A) At deploy time, Java EE containers add a file called MANIFEST.MF directly into the
MyApp directory.
B) It can instruct your Java EE container to verify, at deploy time, whether you have properly configured your application's classes.
C) At deploy time, Java EE containers add a directory called META-INF directly into the
MyApp directory.
D) At deploy time, Java EE containers add a directory call META-WAR directly into the
MyApp directory.
Solutions:
Question # 1 Answer: Only visible for members | Question # 2 Answer: A | Question # 3 Answer: B | Question # 4 Answer: B,C | Question # 5 Answer: B,C |