| Exam Code/Number: | 1Z0-899Join the discussion |
| Exam Name: | Java EE 6 Web Component Developer Certified Expert Exam |
| Certification: | Oracle |
| Question Number: | 132 |
| Publish Date: | May 29, 2026 |
|
Rating
100%
|
|
A web application wants to expose to its clients an operation that results in a transaction being performed across several systems, for example the transfer of money from one bank account to another Which HTTP method should it use?
Given the java code snippet in contextInitialized method of a ServletContextListner:
ServletRegistration.Dynamic sr = (ServletRegistration.Dynamic)sc.addServlet ("myServlet", myServletClass); sr.addMapping("/abc"); sr.setServletSecurityElement(servletSecurityElement); sr.addMapping("/def"); Which statement is true?
Given that a web application consists of two HttpServlet classes, ServletA and ServletB, and the ServerletA.service method:
20. String key = "com.example.data";
21. session.setAttribute(key, "Hello");
22. object value = session.getAttribute(key);
23.
Assume session is an HttpSession, and is not referenced anywhere else in ServletA.
Which two changes, taken together, ensure that value is equal to "Hello" on line 23? (Choose two)
Which of following annotations can be used in a servlet class?
(i) @javax.annotation.Resource
(ii) @javax.annotation.PreDestroy
(iii) @javax.annotation.security.RunAs
(iv) @javax.annotation.security.RolesAllowed
(v) @javax.servlet.annotation.WebServlet
A web application uses a cookies to track a client as it navigates through the pages that constitutes the application. Which code snippet can be used by the web application to reduce the chance of a cross-site scripting attack by setting some property of the cookie before returning it to the client?