问题:单选题Given this fragment from a Java EE deployment descriptor: 124. beta.html 125. alpha.html And this request from a browser:http://www.sun.com/SCWCDtestApp/register Which statement is correct,when the container receives this request?()A This deployment descriptor is NOT valid.B The container first looks in the register directory for beta.html.C The container first looks in the register directory for alpha.html.D The container first looks for a servlet mapping in the deployment descriptor.
Thursday, March 7, 2024
问题:单选题Given a Filter class definition with this method: 21.public void doFilter(ServletRequest request, 22.ServletResponse response, 23.FilterChain chain) 24.throws ServletException, IOException { 25.// insert code here26. } Which should you insert at line 25 to properly invoke the next filter in the chain,or the target servlet if thereare no more filters?()A chain.forward(request, response);B chain.doFilter(request, response);C request.forward(request, response);D request.doFilter(request, response);
Friday, April 26, 2024
问题:多选题A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr. Which two properly set the title in this scenario?()A<title>${titleStr}</title>B<title>${initParam.titleStr}</title>C<title>${params[0].titleStr}</title>D<title>${paramValues.titleStr}</title>E<title>${initParam[’titleStr’]}</title>
Wednesday, September 21, 2022
问题:单选题Which JSTL code snippet can be used to perform URL rewriting?()A <a href=’<c:url url=foo.jsp/>’ />B <a href=’<c:link url=foo.jsp/>’ />C <a href=’<c:url value=foo.jsp/>’ />D <a href=’<c:link value=foo.jsp/>’ />
Friday, February 9, 2024
问题:单选题Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface: public interface ApplicationController {public String invoke(HttpServletRequest request)} The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext. Which code snippet of the FrontController servlet accomplishes this goal?()A Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);B Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);C RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);D RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
Friday, October 6, 2023
问题:单选题The Squeaky Bean company has decided to port their web application to a new J2EE 1.4 container. Whilereviewing the application, a developer realizes that in multiple places within the current application, nearlyduplicate code exists that finds enterprise beans. Which pattern should be used to eliminate this duplicatecode?()A Transfer ObjectB Front ControllerC Service LocatorD Intercepting FilterE Business DelegateF Model-View-Controller
Saturday, July 15, 2023
问题:单选题Which basic authentication type is optional for a J2EE 1.4 compliant web container?()A HTTP Basic AuthenticationB Form Based AuthenticationC HTTP Digest AuthenticationD HTTPS Client Authentication
Tuesday, August 29, 2023
问题:多选题Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()AObject o = pageContext.getAttribute(foo);BObject o = pageContext.findAttribute(foo);CObject o = pageContext.getAttribute(foo,PageContext.SESSION_SCOPE);DHttpSession s = pageContext.getSession();Object o = s.getAttribute(foo);
问题:单选题Which path is required to be present within a WAR file?()A /classesB /index.htmlC /MANIFEST-INFD /WEB-INF/web.xmlE /WEB-INF/classes
Sunday, May 14, 2023
问题:多选题A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()A<prefix:myTag a=foo b=bar c=baz />B<prefix:myTag attributes={foo,bar,baz} />C<prefix:myTag jsp:attribute a=foo b=bar c=baz />D<prefix:myTag><jsp:attribute name=a>foo</jsp:attribute><jsp:attribute name=b>bar</jsp:attribute><jsp:attribute name=c>baz</jsp:attribute>. </prefix:myTag>
问题:单选题The JSP developer wants a comment to be visible in the final output to the browser. Which comment styleneeds to be used in a JSP page?()A <!-- this is a comment -->B <% // this is a comment %>C <%-- this is a comment --%>D <% /** this is a comment **/ %>
Sunday, January 8, 2023
问题:单选题You have a new IT manager that has mandated that all JSPs must be refactored to include no scritpletcode. The IT manager has asked you to enforce this. Which deployment descriptor element will satisfy thisconstraint?()A <jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <permit-scripting>false</permit-scripting>. </jsp-property-group>B <jsp-config>. <url-pattern>*.jsp</url-pattern><permit-scripting>false</permit-scripting>. </jsp-config>C <jsp-config>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-config>D <jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-property-group>
Sunday, March 26, 2023
问题:单选题Which ensures that a JSP response is of type "text/plain"?()A <%@ page mimeType=text/plain %>B <%@ page contentType=text/plain %>C <%@ page pageEncoding=text/plain %>D <%@ page contentEncoding=text/plain %>E <% response.setEncoding(text/plain); %>
问题:单选题Which security mechanism uses the concept of a realm?()A AuthorizationB Data integrityC ConfidentialityD Authentication
问题:多选题Given: 11. 15. Which three EL expressions, inserted at line 15,are valid and evaluate to "3"?()A${vals.2}B${vals[2]}C${vals.index}D${vals[index]}E${vals}[index]F${vals[vals[index-1]]}
问题:多选题A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()AidBnameCbeanDtypeEscope
问题:单选题To take advantage of the capabilities of modern browsers that use web standards, such as XHTML andCSS, your web application is being converted from simple JSP pages to JSP Document format. However,one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in severalweb forms to create screen-specific validation functions and are included in these pages with the followingstatement: 10. 11. 14. 15. Which JSP code snippet declares that this JSP Document is a JavaScript file?()A <%@ page contentType=’application/javascript’ %>B <jsp:page contentType='application/javascript' />C <jsp:document contentType='application/javascript' />D <jsp:directive.page contentType='application/javascript' />E No declaration is needed because the web form XHTML page already declares the MIME type of the /scripts/screenFunctions.jsp file in the <script> tag.tag.
Friday, September 8, 2023
问题:多选题Given: 3.class MyServlet extends HttpServlet { 4.public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { 5.// servlet code here ... 26.} 27.} If the DD contains a single security constraint associated with MyServlet and its only tagsand tags are:GETPUT Admin Which four requests would be allowed by the container?()AA user whose role is Admin can perform a PUT.BA user whose role is Admin can perform a GET.CA user whose role is Admin can perform a POST.DA user whose role is Member can perform a PUT.EA user whose role is Member can perform a POST.FA user whose role is Member can perform a GET.
问题:单选题You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?()A <jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>B <jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>C <jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>D <jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>
Wednesday, December 13, 2023