1Z0-899 | Abreast of the times Oracle 1Z0-899 exam question


Q41. You have a use in your web application that adds several session-scoped attributes. At the end of the use case, one of these objects, the manage attribute, is removed and then it needs to decide which of the other session-scoped attributes to remove. 

How can this goal be accomplished? 

A. The object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes. 

B. The object of the manager attribute should implement the HttpSessionListenar and it should call the removeAttribute method on the appropriate session attributes. 

C. The object of the manager attribute should implement the HttpSessionBindingListener rind it should call the deleteAttribute method on the appropriate session attributes. 

D. The object of the manager attribute should implement the HttpsessionListener and it should call the deleteAttribute method on the appropriate session attributes. 

Answer: A

Q42. To add a servlet to a context that has not been declared either via annotation or via the descriptor, during context initialization time the following API can be used (Choose three.) 

A. servletContext.addServlet(“myServletName”, “MyServlet”); 

B. servletContext.addServlet( (<Class extends Servlet>)getClass().getClassLoader().getClassLoader().loaderClass(“MyServlet”)); 

C. servletContext.addServlet(myServlet); 

D. servletContext.addServlet( (“myServletName”, <Class extends Servlet>)gerClass().getClassLoader().loaderClass(“myServlet”)); 

E. servletContext.addServlet(“myServletName”, MyServlet); 

Answer: ADE 

Q43. You need to create a JavaBean object that is used only within the current ISP page. It must NOT be accessible to any other page including those that this page might import. 

Which JSP standard action < .in accomplish this goal? 

A. <jsp:useBean id = ‘pageBean’ type = ‘com.example.MyBean’ /> 

B. <jsp:useBean id = ‘pageBean’ class = ‘com.example.MyBean’ /> 

C. <jsp:makeBean id = ‘pageBean’ type = ‘com.example.MyBean’ /> 

D. <jsp:makeBean id = ‘pageBean’ class = ‘com.example.MyBean’ /> 

E. <jsp:useBean id = ‘pageBean’ class = ‘com.example.MyBean’ /> 

F. <jsp:makeBean id = ‘pageBean’ class = ‘com.example.MyBean’ /> 

Answer: B

Q44.  

</error-page> 

Q45. Given this fragment in a servlet: 

23. 

if(reg.isUserInRole(“Admin”)) { 

Q46.  

public class Myobject implements 

Q47. Which interface must a class implement so that instances of the class are notified after any object added to a session? 

A. javax.servlet.http.HttpSessionListener 

B. javax.servlet.http.HttpSessionValueListener 

C. javax.servlet.http.HttpSessionBindingListener 

D. javax.servlet.http.HttpSessionAttributeListener 

Answer: D

Q48.

 Product Name: <input type= ‘text’ name=‘productName’/><br/> 

Q49. A session-scoped attribute is stored by a servlet, and then servlet forwards to a JSP page. Which three jsp:useBean attributes must be used to access this attribute in the JSP page? (Choose three.) 

A. id 

B. name 

C. bean 

D. type 

E. scope 

F. beanName 

Answer: ADE 

Q50.  

response.getWriter().print(age);