[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-899 Dumps with VCE and PDF Download 11-20

EnsurePass 2018 Jan Oracle Official New Released 1z0-899
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-899.html

Java EE 6 Web Component Developer Certified Expert Exam

Question No: 11

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 the servlet to the JSP for view generation. This information must NOT be accessible to any other servlet, JSP or session in the webapp. Which two techniques can you use to accomplish this goal? (Choose two)

  1. Add attributes to the session object.

  2. Add attributes on the request object.

  3. Add parameters on the request object.

  4. Use the pageContext object to add request attributes.

  5. Add parameters to the JSP’s URL when generating the request dispatcher.

Answer: B,E

Question No: 12

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 that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hasmap of session objects by the ID. Here is a partial implementation of this servlet:

  1. public class SessionAgeServlet extends HttpServlet {

  2. public void service(HttpServletRequest request, HttpServletResponse) throws IOException {

  3. String sessionID = request.getParameter(quot;sessionIDquot;);

  4. HttpSession session = getSession(sessionID);

  5. long age = // your code here

  6. response.getWriter().print(age);

16. }

… // more code here

47. }

Which code snippet on line 14, will determine the age of the session?

  1. session.getMaxInactiveInterval();

  2. session.getLastAccessed().getTime() – session.getCreationTime().getTime();

  3. session.getLastAccessedTime().getTime() – session.getCreationTime().getTime();

  4. session.getLastAccessed() – session.getCreationTime();

  5. session.getMaxInactiveInterval() – session.getCreationTime();

  6. session.getLastAccessedTime() – session.getCreationTime();

Answer: F

Question No: 13

You are creating a JSP page to display a collection of data. This data can be displayed in several different ways so the architect on your project decided to create a generic servlet that generates a comma delimited string so that various pages can render the data in different ways. This servlet takes on request parameter: objoctID. Assume that this servlet is mapped to the URL pattern: /WEB-INF/data.

In the JSP you are creating, you need to split this string into its elements separated by commas and generate an HTML lt;ulgt; list from the data.

Which JSTL code snippet will accomplish this goal?

  1. lt;c:import varReader=#39;dataString#39; url=#39;/WEB-INF/data#39;gt;

    lt;c:param name=#39;objectID#39; value=#39;${currentOID}#39; /gt;

    lt;/c:importgt;

    lt;ulgt;

    lt;c:forTokens items#39;${dataString.split(quot;,quot;)}#39; var=#39;item#39;gt;

    lt;ligt;${item}lt;/ligt;

    lt;/c:forTokensgt;

    lt;/ulgt;

  2. lt;c:import varReader=#39;dataString#39; url=#39;/WEB-INF/data#39;gt;

    lt;c:param name=#39;objectID#39; value=#39;${currentOID}#39; /gt;

    lt;/c:importgt;

    lt;ulgt;

    lt;c:forTokens items#39;${dataString}#39; delims=#39;,#39; var=#39;item#39;gt;

    lt;ligt;${item}lt;/ligt;

    lt;/c:forTokensgt;

    lt;/ulgt;

  3. lt;c:import var=#39;dataString#39; url=#39;/WEB-INF/data#39;gt;

    lt;c:param name=#39;objectID#39; value=#39;${currentOID}#39; /gt;

    lt;/c:importgt;

    lt;ulgt;

    lt;c:forTokens items#39;${dataString.split(quot;,quot;)}#39; var=#39;item#39;gt;

    lt;ligt;${item}lt;/ligt;

    lt;/c:forTokensgt;

    lt;/ulgt;

  4. lt;c:import var=#39;dataString#39; url=#39;/WEB-INF/data#39;gt;

lt;c:param name=#39;objectID#39; value=#39;${currentOID}#39; /gt;

lt;/c:importgt;

lt;ulgt;

lt;c:forTokens items#39;${dataString}#39; delims=#39;,#39; var=#39;item#39;gt;

lt;ligt;${item}lt;/ligt;

lt;/c:forTokensgt;

lt;/ulgt;

Answer: D

Question No: 14

Given a web fragment jar file, where should we put the web fragment.xml inside the jar file?

  1. WEB-INF

  2. META-INF

  3. WEB-INF/lib

  4. WEB-INF/classes

  5. META-INF/services

Answer: C

Explanation: * If you#39;re dealing with web applications, /WEB-INF/lib is the portable place to put JARs. This is where web servers servlet containers expect to find an application#39;s jar files.

* The /WEB-INF/classes directory is on the ClassLoader#39;s classpath. This is where .class files are loaded from when the web application is executing. Any JAR files placed in the

/WEB-INF/lib directory will also be placed on the ClassLoader#39;s classpath.

Question No: 15

You are building a web application with a scheduling component. On the JSP, you need to show the current date, the date of the previous week, and the date of the next week.

To help you present this information, you have created the following EL functions in the ‘d’ namespace:

->Name : curData; signature: java.util.utilDate CurrentDate()

->Name : curData; signature: java.util.utilDate addweek (java.util.Date, int)

->Name: dateString; signature: java.util.String getDataString (jave.util.Data)

Which EL code snippet will generate the string for the previous week?

  1. ${d:dateString(affWeek(curDate(), -1)) }

  2. ${d:dateString [addWeek[curDate[], – ]] }

  3. ${d:dateString [d:addWeek[d:curDate[], – 1]] }

  4. ${d:dateString (d:addWeek(d:curDate(), -1)) }

Answer: D

Question No: 16

View the Exhibit.

Ensurepass 2018 PDF and VCE

Given:

  1. lt;form action=’create_product.jsp’gt;

  2. Product Name: lt;input type= ‘text’ name=’productName’/gt;lt;br/gt;

  3. Product Price: lt;input type= ‘text’ name=’productPrice’/gt;lt;br/gt;

  4. lt;/formgt;

For a given product instance, which three jsp:setProperty attributes must be used to initialize its properties from the HTML form? (Choose three.)

  1. id

  2. name

  3. type

  4. param

  5. property

  6. reqParam

  7. attribute

Answer: B,D,E

Question No: 17

Your web application requires the ability to load and remove web files dynamically to the web container’s file system? Which two HTTP methods are used to perform these actions? (Choose two)

  1. PUT

  2. POST

  3. SEND

  4. DELETE

  5. REMOVE

  6. DESTROY

Answer: A,D

Question No: 18

Which two statements are true about the security-related tags in a valid Java EE deployment descriptor? (Choose two)

  1. Every lt;security-constraintgt; tag must have at least one lt;http-methodgt; tag.

  2. A lt;security-constraintgt; tag can have many lt;web-resource-collectiongt; tags.

  3. A given lt;auth-constraintgt; tag can apply to only one lt;web-resource-collectiongt; tag.

  4. A given lt;web-resource-collectiongt; tag can contain from zero to many lt;url-patterngt; tags.

  5. It is possible to construct a valid lt;security-constraintgt; tag such that, for a given resource user roles can access that resource.

Answer: B,E

Question No: 19

Users of your web application have requested that they should be able to set the duration of their sessions. So for example, one user might want a webapp to stay connected for an hour rather than the webapp#39;s default of fifteen minutes; another user might want to stay connected for a whole day.

Furthermore, you have a special login servlet that performs user authentication and retrieves the object from the database. You want to augment this code to set up the user#39;s specified session duration.

Which code snippet in the login servlet will accomplish this goal?

  1. User user = / / retrieves the user objects object from the database session.setDurationInterval (user.getSessionDuration());

  2. User user = / / retrieves the User objects from the database session.setInactiveInterval (user.getSessionDuration());

  3. User user = / / retrieves the user objects object from the database session.setInactiveInterval (user.get.SessionDuration());

  4. User user = / / retrieves the user objects object from the database session.setDuration (user.getSessionDuration());

  5. User user = / / retrieves the user objects object from the database session.setMaxInactiveInterval (user.getSessionDuration());

  6. User user = / / retrieves the user objects object from the database session.setMaxDurationInterval (user.getSessionDuration());

Answer: E

Question No: 20

Which three are true about the HttpServletRequestWrapper class? (Choose three.)

  1. The HttpServletRequestWrapper is an example of the Decorator pattern.

  2. The HttpServletRequestWrapper can be used to extend the functionality of a servlet request.

  3. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the getReader method.

  4. An HttpServletRequestWrapper may be used only by a class implement the javax.servlet.Filter interface.

  5. An HttpServletRequestWrapper CANNOT be used on the request passed to the RequestDispatcher.interface.

  6. An HttpServletRequestWrapper may modify the header of a request within an object implementing the javax.servlet.Filter interface.

Answer: A,B,F

100% Free Download!
Download Free Demo:1z0-899 Demo PDF
100% Pass Guaranteed!
Download 2018 EnsurePass 1z0-899 Full Exam PDF and VCE

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

2018 EnsurePass IT Certification PDF and VCE