Which method should the servlet use to access the uploaded files?

A web application for business expense reporting allows uploading expense receipts. Multiple receipts can be uploaded single step using one HTTP request. Theservlet that processes the request has been marked with the @MultipartConfig annotation. Which method should the servlet use to access the uploaded files? A. HttpServletRequest.getParts() B. HttpServletRequest.getData() C. servletRequest.getParts() D. servletRequest.getAllParts() Explanation:The request.getParts() […]

Read More

Which two techniques can you use to accomplish this goal?

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 passinformation 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 […]

Read More

Which EL expression returns true if no session has been established with current client?

Which EL expression returns true if no session has been established with current client? A. ${not(pageContext.session)} B. ${not(requestScope.session)} C. ${requestScope.sessions.this} D. ${sessionScope.empty} Explanation:Note:* A session is never null. The session is always present in JSP EL, unless you add<%@page session=”false” %>* If you’d like to check if the session is new or has already been […]

Read More

Which two are true?

Given an EL function declared with: Which two are true? (Choose two) A. The function method must have the signature: public String spin(). B. The method must be mapped to the logical name “spin” in the web.xml file. C. The function method must have the signature: public String spinIt(). D. The function method must have […]

Read More

Which two EL code snippets will return true for this condition?

You are building a dating web site. The client’s date of birth is collected along with lots of other information. The Person class has a derived method, getAge() :int,which returns the person’s age calculated from the date of birth and today’s date. In one of your JSPs you need to print a special message to […]

Read More

Which EL expression evaluates to the request URI?

Which EL expression evaluates to the request URI? A. ${requestURI} B. ${request.URI} C. ${request.getURI} D. ${request.requestURI} E. ${requestScope.requestURI} F. ${pageContext.request.requestURI} G. ${requestScope.request.requestDRI} Show Answer

Read More

Which JSP code snippet creates this email link?

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 adifferent email address for the web master. You have decided to use a context parameter that you specify in the deployment descriptor, like this:42. <context-param>43. […]

Read More

What should you do to address this problem?

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 representsthe cause of the problem, but your IDE is telling you that the variable does not exist. What should you do to address this problem? A. Add […]

Read More

Which JSP code, inserted at line 1, completes the JSP code to invoke the hello tag?

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, completes the JSP code to invoke the hello tag? A. <%@ taglib prefix=”ex” uri=”/WEB-INF/tld” %> B. <%@ taglib uri=”/WEB-INF/tld/example.tld” %> C. <%@ taglib prefix=”ex” uri:=”http://localhost:8080/tld/example.tld” %> […]

Read More

Which JSP code snippet performs the import of the heade

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> tag that requests the page name to be specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content? A. […]

Read More