Oracle Java Enterprise Edition 5 Web Component Developer Certified Professional Sample Questions:
1. A developer is designing the presentation tier for a web application which requires a centralized request handling to complete common processing required by each request. Which design pattern provides a solution to this problem?
A) Front Controller
B) Business Delegate
C) Intercepting Filter
D) Remote Proxy
E) Data Access Object
F) Service Activator
2. Which implicit object is used in a JSP page to retrieve values associated with <contextparam> entries in the deployment descriptor?
A) config
B) session
C) request
D) application
3. Every page of your web site must include a common set of navigation menus at the top of the page. This menu is static HTML and changes frequently, so you have decided to use JSP's static import mechanism. Which JSP code snippet accomplishes this goal?
A) <%@ include file='/common/menu.html' %>
B) <%@ include page='/common/menu.html' %>
C) <%@ import page='/common/menu.html' %>
D) <%@ page import='/common/menu.html' %>
E) <%@ import file='/common/menu.html' %>
F) <%@ page include='/common/menu.html' %>
4. Your web application uses a simple architecture in which servlets handle requests and then forward to a JSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation. This information must NOT be accessible to any other servlet, JSP or session in the webapp. Which two techniques can you use to accomplish this goal? (Choose two.)
A) Add attributes on the request object.
B) Add attributes to the session object.
C) Add parameters to the JSP's URL when generating the request dispatcher.
D) Add parameters to the request object.
E) Use the pageContext object to add request attributes.
5. Given this fragment in a servlet:
23.
if(req.isUserInRole("Admin")) {
24.
// do stuff
25.
}
And the following fragment from the related Java EE deployment descriptor:
812.
<security-role-ref>
813.
<role-name>Admin</role-name>
814.
<role-link>Administrator</role-link>
815.
</security-role-ref>
900.
<security-role>
901.
<role-name>Admin</role-name>
902.
<role-name>Administrator</role-name>
903.
</security-role>
What is the result?
A) If line 24 executes, the user's role will be Admin.
B) The deployment descriptor is NOT valid.
C) Line 24 can never be reached.
D) If line 24 executes the user's role will NOT be predictable.
E) If line 24 executes, the user's role will be Administrator.
Solutions:
Question # 1 Answer: A | Question # 2 Answer: D | Question # 3 Answer: A | Question # 4 Answer: A,C | Question # 5 Answer: E |