1Z0-899 Exam Questions
197 real 1Z0-899 exam questions with expert-verified answers and explanations. Page 4 of 4.
- Question #151
Assume the custom tag my:errorProne always throws a jav a.lang.RuntimeException with the message "File not found."An error page has been configured for this JSP page. Which option...
- Question #152
Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name is of type java.lang.String and the attribute score is of type java.lang.Integer. An...
- Question #153
You have been contracted to create a web site for a free dating service. One feature is the ability for one client to send a message to another client, which is displayed in the la...
- Question #154
Which is a benefit of precompiling a JSP page?
- Question #155
A web browser need NOT always perform a complete request for a particular page that it suspects might NOT have changed. The HTTP specification provides a mechanism for the browser...
- Question #156
A Client wants to retrieve a representation of a resource, for example an HTML page, allowing a cached version to be returning by an intermediary such a proxy server. Which HTTP me...
- Question #157
View the exhibit. Assume the tag library in the exhibit is placed in a web application in the path /WEB- INF/tld/example.tld. 1. 2. <ex:hello /> Which JSP code, inserted at line 1,...
- Question #158
You are building your own layout mechanism by including dynamic content for the page's header and footer sections. The footer is always static, but the header generates the <title>...
- Question #159
You are working on a JSP that is intended to inform users about critical errors in the system. The JSP code is attempting to access the exception that represents the cause of the p...
- Question #160
All of your JSPs need to have a link that permits users to email the web master. This web application is licensed to many small businesses, each of which have a different email add...
- Question #161
Given an EL function declared with: Which two are true? (Choose two)
- Question #162
Which EL expression returns true if no session has been established with current client?
- Question #163
Your web application uses a simple architecture in which servlets handle requests and then forward to a JSP using a request dispatcher. You need to pass information calculated in t...
- Question #164
A web application for business expense reporting allows uploading expense receipts. Multiple receipts can be uploaded single step using one HTTP request. The servlet that processes...
- Question #165
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...
- Question #166
ServletContextListeners are invoked in
- Question #167
A servlet class is injected with a JDBC data source. After injection has occurred, the servlet needs to create a cache out of some of the data in the database, so as to improve res...
- Question #168
View the Exhibit. Which two technologies would be suitable for use as Front Controller elements? (Choose two)
- Question #169
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-...
- Question #170
Given a war file with the following structure | - WEB-INF/classes/Myservlet.class | - WEB-INF/lib/wf.jaf Where wf.jar contains a valid web-fragment.xml and the following two classe...
- Question #171
Which three are true about the HttpServletRequestWrapper class? (Choose three.)
- Question #172
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 original request received by...
- Question #173
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...
- Question #174
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 properties to...
- Question #175
View the Exhibit. Given: 10. <form action=`create_product.jsp'> 11. Product Name: <input type= `text' name=`productName'/><br/> 12. Product Price: <input type= `text' name=`product...
- Question #176
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. Whi...
- Question #177
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.setAttr...
- Question #178
Given an HttpServletRequest request: 22. String id = request.getParameter("jsessionid"); 23. // insert code here 24. String name = (String) session.getAttribute("name") Which three...
- Question #179
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 tha...
- Question #180
Given the definition of Myobject and that an instance of Myobject is bound as a session attribute: 8. package com.example; 9. public class Myobject implements 10. javax.servlet.htt...
- Question #181
Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an important session attrib...
- Question #182
Which method must be used to encode a URL passed as an argument to HttpServletResponse. sendRedirect when using URL rewriting for session tracking?
- Question #183
Which Java expression can be used to check whether the web container is currently configured to track sessions via URL rewriting?
- Question #184
Which security mechanism uses the concept of a realm?
- Question #185
Which java code snippet roles "MANAGER" and "EMPLOYEE" in a given application? @DeclareRole("EMPLOYEE") public class MyServlet extends HttpServlet {}
- Question #186
Given the java code snippet in contextInitialized method of a ServletContextListner: ServletRegistration.Dynamic sr = (ServletRegistration.Dynamic)sc.addServlet ("myServlet", mySer...
- Question #187
Given: 3. class MyServlet extends HttpServlet { 4. public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 5. // servlet code her...
- Question #188
Given this fragment in a servlet: 23. if(reg.isUserInRole("Admin")) { 24. // do stuff 25. } And the following fragment from the related Java EE deployment descriptor: 812. <securit...
- Question #189
Which java code snippet checks whether the user is of the role "MANAGER" for a given HttpServRequest, httpServletRequest?
- Question #190
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 redu...
- Question #191
Given a web fragment jar file, where should we put the web fragment.xml inside the jar file?
- Question #192
Given the portion of a valid Java EE web application's directory structure: You want to know whether File1.html, File2.html, and/or File3.html is protected from direct access by yo...
- Question #193
Given the fragment from Java EE deployment descriptor: 341. <error-page> 342. <exception-type>java.lang.Throwable</exception-type> 343. <location>/mainError.jsp</location> 344. </e...
- Question #194
You have built a web application that you license to small businesses. The webapp uses a context parameter, called licenseExtension, which enables certain advanced features based o...
- Question #195
Which of the following are attributes of the annotation javax.servlet.annotation.WebFiler? (i) Name (ii) servletNames (iii) urlPatterns (iv) dispatcherTypes (v) supportAsync
- Question #196
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.a...
- Question #197
When using the @WebListener annotation, the class on which the annotation is applied to must also implement at least one o the following interfaces ?(Choose two):