SUN Sun Certified Web Component Developer for J2EE 5 Sample Questions:
1. DRAG DROP
Click the Task button.
Given a request from mybox.example.com, with an IP address of 10.0.1.11 on port 33086, place the appropriate ServletRequest methods onto their corresponding return values.
2. 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/>
3. Which two JSTL URL-related tags perform URL rewriting? (Choose two.)
A) url
B) param
C) import
D) redirect
E) link
4. Given a header in an HTTP request:
X-Retries: 4
Which two retrieve the value of the header from a given HttpServletRequest request?
(Choose two.)
A) request.getHeaders("X-Retries").get(0)
B) request.getIntHeader("X-Retries")
C) request.getRequestHeaders("X-Retries").get(0)
D) request.getRequestHeader("X-Retries")
E) request.getHeader("X-Retries")
5. The Squeaky Bean company has decided to port their web application to a new J2EE 1.4 container. While reviewing the application, a developer realizes that in multiple places within the current application, nearly duplicate code exists that finds enterprise beans.
Which pattern should be used to eliminate this duplicate code?
A) Front Controller
B) Model-View-Controller
C) Service Locator
D) Transfer Object
E) Business Delegate
F) Intercepting Filter
Solutions:
| Question # 1 Answer: Only visible for members | Question # 2 Answer: B,C | Question # 3 Answer: A,D | Question # 4 Answer: B,E | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By Ronald

