SUN Sun Certified Web Component Developer for J2EE 5 - 310-083 FREE EXAM DUMPS QUESTIONS & ANSWERS
Click the Exhibit button. Given the web application deployment descriptor elements:
1 1. <filter>
1 2. <filter-name>ParamAdder</filter-name>
1 3. <filter-class>com.example.ParamAdder</filter-class>
1 4. </filter>
...
3 1. <filter-mapping>
3 2. <filter-name>ParamAdder</filter-name>
3 3. <servlet-name>Destination</servlet-name>
3 4. </filter-mapping>
...
5 5. <servlet-mapping>
5 6. <servlet-name>Destination</servlet-name>
5 7. <url-pattern>/dest/Destination</url-pattern>
5 8. </servlet-mapping>
What is the result of a client request of the Source servlet with no query string?

1 1. <filter>
1 2. <filter-name>ParamAdder</filter-name>
1 3. <filter-class>com.example.ParamAdder</filter-class>
1 4. </filter>
...
3 1. <filter-mapping>
3 2. <filter-name>ParamAdder</filter-name>
3 3. <servlet-name>Destination</servlet-name>
3 4. </filter-mapping>
...
5 5. <servlet-mapping>
5 6. <servlet-name>Destination</servlet-name>
5 7. <url-pattern>/dest/Destination</url-pattern>
5 8. </servlet-mapping>
What is the result of a client request of the Source servlet with no query string?

Correct Answer: B
Vote an answer
Which statement is true about web container session management?
Correct Answer: D
Vote an answer
In which two locations can library dependencies be defined for a web application? (Choose two.)
Correct Answer: A,D
Vote an answer
Given:
http://com.example/myServlet.jsp?num=one&num=two&num=three
Which two produce the output "one, two and three"? (Choose two.)
http://com.example/myServlet.jsp?num=one&num=two&num=three
Which two produce the output "one, two and three"? (Choose two.)
Correct Answer: A,B
Vote an answer
Given that a scoped attribute cart exists only in a user's session, which two, taken independently, ensure the scoped attribute cart no longer exists? (Choose two.)
Correct Answer: C,D
Vote an answer
You have built a web application with tight security. Several directories of your webapp are used for internal purposes and you have overridden the default servlet to send an HTTP
403 status code for any request that maps to one of these directories. During testing, the
Quality Assurance director decided that they did NOT like seeing the bare response page generated by Firefox and Internet Explorer. The director recommended that the webapp should return a more user-friendly web page that has the same look-and-feel as the webapp plus links to the webapp's search engine. You have created this JSP page in the
/WEB-INF/jsps/error403.jsp file. You do NOT want to alter the complex logic of the default servlet. How can you declare that the web container must send this JSP page whenever a
4 03 status is generated?
403 status code for any request that maps to one of these directories. During testing, the
Quality Assurance director decided that they did NOT like seeing the bare response page generated by Firefox and Internet Explorer. The director recommended that the webapp should return a more user-friendly web page that has the same look-and-feel as the webapp plus links to the webapp's search engine. You have created this JSP page in the
/WEB-INF/jsps/error403.jsp file. You do NOT want to alter the complex logic of the default servlet. How can you declare that the web container must send this JSP page whenever a
4 03 status is generated?
Correct Answer: B
Vote an answer
You web application uses a lot of Java enumerated types in the domain model of the application. Built into each enum type is a method, getDisplay(), which returns a localized, user-oriented string. There are many uses for presenting enums within the web application, so your manager has asked you to create a custom tag that iterates over the set of enum values and processes the body of the tag once for each value; setting the value into a page-scoped attribute called, enumValue. Here is an example of how this tag is used:
1 0. <select name='season'>
1 1. <t:everyEnum type='com.example.Season'>
1 2. <option value='${enumValue}'>${enumValue.display}</option>
1 3. </t:everyEnum>
1 4. </select>
You have decided to use the Simple tag model to create this tag handler.
Which tag handler method will accomplish this goal?
1 0. <select name='season'>
1 1. <t:everyEnum type='com.example.Season'>
1 2. <option value='${enumValue}'>${enumValue.display}</option>
1 3. </t:everyEnum>
1 4. </select>
You have decided to use the Simple tag model to create this tag handler.
Which tag handler method will accomplish this goal?
Correct Answer: D
Vote an answer
As a convenience feature, your web pages include an Ajax request every five minutes to a special servlet that monitors the age of the user's session. The client-side JavaScript that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hashmap of session objects by the ID. Here is a partial implementation of this servlet:
10. public class SessionAgeServlet extends HttpServlet {
11. public void service(HttpServletRequest request, HttpServletResponse) throws
IOException {
1 2. String sessionID = request.getParameter("sessionID");
1 3. HttpSession session = getSession(sessionID);
1 4. long age = // your code here
1 5. response.getWriter().print(age);
16. } ... // more code here
47. }
Which code snippet on line 14, will determine the age of the session?
10. public class SessionAgeServlet extends HttpServlet {
11. public void service(HttpServletRequest request, HttpServletResponse) throws
IOException {
1 2. String sessionID = request.getParameter("sessionID");
1 3. HttpSession session = getSession(sessionID);
1 4. long age = // your code here
1 5. response.getWriter().print(age);
16. } ... // more code here
47. }
Which code snippet on line 14, will determine the age of the session?
Correct Answer: F
Vote an answer