READ Free Dumps For Oracle- 1z0-899
Question ID 4703 | A developer wants to make a name attribute available to all servlets associated with a particular user, across multiple requests from that user, from the same browser instance. |
Option A | A. pageContext.setAttribute(“name”, theValue); |
Option B | B. pageContext.setAttribute(“name”, getSession() ); |
Option C | C. pageContext.getRequest().setAttribute(“name”, theValue); |
Option D | D. pageContext.getSession().setAttribute(“name”, theValue); |
Option E | E. pageContext.setAttribute(“name”, theValue, PageContext.PAGE_SCOPE); |
Option F | F. pageContext.setAttribute(“name”, theValue, PageContext.SESSION_SCOPE); |
Correct Answer | D,F |
Question ID 4704 | Given that a web application consists of two HttpServlet classes, ServletA and ServletB, and the ServerletA.service method: |
Option A | A. ensure that the ServletB.service method is synchronized |
Option B | B. ensure that the ServletA.service method is synchronized |
Option C | C. ensure that ServletB synchronizes on the session object when setting session attributes |
Option D | D. enclose lines 21-22 in synchronized block: |
Option E | E. enclose lines 21-22 in synchronized block: |
Correct Answer | C,E |