Category «1Z0-899»

Which two create an instance of com.example.Product and initialize the name and price properties to the name and price request parameters?

View the Exhibit. Assume the product attribute does NOT yet exist in any scope. Which two create an instance of com.example.Product and initialize the name and price propertiesto the name and price request parameters? (Choose two) A. <jsp:useBean id=”product” class=”com.example.Product” /> <jsp:setProperty name=”product” property=”*” /> B. <jsp:useBean id=”product” class=”com.example.Product” /> <% product.setName( request.getParameter( “name” ) …

What attribute in B’s request object contains the URI of the original request received by servlet A?

Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attribute in B’s request object contains the URI of the originalrequest received by servlet A? A. REQUEST_URI B. javax.servlet.forward.request_uri C. javax.servlet.forward.REQUEST_URI D. javax.servlet.request_dispatcher.request_uri E. javax.servlet.request_dispatcher.REQUEST_URI Show Answer

which filters will be executed?

Given a war file with the following structure| – WEB-INF/classes/Myservlet.class| – WEB-INF/lib/wf.jafWhere wf.jar contains a valid web-fragment.xml and the following two classes: MyFilter1.class and MyFiler2.class.The web-fragment.xml is as follows: The following are some code snippets: When one access “/” of the above web application, which filters will be executed? A. No filters will be executed. …

Which three are true about the HttpServletRequestWrapper class?

Which three are true about the HttpServletRequestWrapper class? (Choose three.) A. The HttpServletRequestWrapper is an example of the Decorator pattern. B. The HttpServletRequestWrapper can be used to extend the functionality of a servlet request. C. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the getReader method. D. An HttpServletRequestWrapper may be used only by …

What is the result of a client request of the Source servlet with no query string?

View the Exhibit. Given the web application deployment descriptor elements:11. <filter>12. <filter-name>ParamAdder</filter-name>13. <filter-class>com.example.ParamAdder</filter-class>14. </filter>…31. <filter-mapping>32. <filter-name>ParamAdder</filter-name>33. <servlet-name>Destination</servlet-name>34. </filter-mapping>…55. <servlet-mapping>56. <servlet-name>Destination</servlet-name> 57. <url-pattern>/dest/Destination</url-pattern>58. </servlet-mapping>What is the result of a client request of the Source servlet with no query string? A. The output “filterAdded = null” is written to the response stream. B. The output “filterAdded = …

ServletContextListeners are invoked in

ServletContextListeners are invoked in A. Random order B. contextInitialized and contextDestroyed are invoked in the order in which they are declared in the web.xml C. contextInitialized method are invoked in the order in which they are declared in the web.xml and the contextDestroyed method is invoked in the reverse order in which they are declared …

To add a servlet to a context that has not been declare

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); Explanation:addServletServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.Class<? extends Servlet> …