问题:单选题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, September 21, 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>
Sunday, July 21, 2024
问题:多选题Given the JSP code: 10. 11. 12. 13.Hello, ${customer.title} ${customer.lastName}, welcome 14.to Squeaky Beans, Inc. 15.16. Which three types of JSP code are used?()AJava codeBTemplate textCScripting codeDStandard actionEExpression language
Monday, July 1, 2024
问题:单选题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); %>
Tuesday, September 17, 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);
Monday, November 4, 2024
问题:单选题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, September 15, 2024
问题:单选题Which element of a web application deployment descriptor element is required?()A <realm-name>B <auth-method>C <security-role>D <transport-guarantee>E <web-resource-collection>
Thursday, March 7, 2024
问题:多选题Given: 11. 16. Which three EL expressions, inserted at line 16, are valid and evaluate to "d"?()A${map.c}B${map[c]}C${map[c]}D${map.map.b}E${map[map.b]}
问题:单选题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 JSP standard action can be used to import content from a resource called foo.jsp?()A <jsp:import file=’foo.jsp’ />B <jsp:import page=’foo.jsp’ />C <jsp:include page=’foo.jsp’ />D <jsp:include file=’foo.jsp’ />
Tuesday, September 20, 2022
问题:单选题You have created a web application that you license to real estate brokers. The webapp is highly customizable including the email address of the broker, which is placed on the footer of each page. This isconfigured as a context parameter in the deployment descriptor: 10. 11.footerEmail 12.joe@estates-r-us.biz 13. Which EL code snippet will insert this context parameter into the footer?()A <a href=’mailto:${footerEmail}’>Contact me</a>B <a href=’mailto:${initParam@footerEmail}’>Contact me</a>C <a href=’mailto:${initParam.footerEmail}’>Contact me</a>D <a href=’mailto:${contextParam@footerEmail}’>Contact me</a>E <a href=’mailto:${contextParam.footerEmail}’>Contact me</a>
问题:多选题Given that a scoped attribute cart exists only in a user’s session, which two,taken independently,ensurethe scoped attribute cart no longer exists?()A${cart = null}B<c:remove var=cart />C<c:remove var=${cart} />D<c:remove var=cart scope=session />E<c:remove scope=session>cart</c:remove>
问题:单选题A developer is designing a web application that must support multiple interfaces,including: an XML web service for B2B HTML for web-based clients WML for wireless customers. Which designpattern provides a solution for this problem?()A Session FacadeB Business DelegateC Data Access ObjectD Model-View-ControllerE Chain of Responsibility
问题:多选题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
问题:多选题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.
Tuesday, October 29, 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);
问题:多选题Which three are valid URL mappings to a servlet in a web deployment descriptor?()A*/*B*.doCMyServletD/MyServletE/MyServlet/*FMyServlet/*.jsp
Sunday, October 27, 2024
问题:多选题You are designing an n-tier Java EE application. You have already decided that some of your JSPs willneed to get data from a Customer entity bean. You are trying to decide whether to use a Customer stubobject or a Transfer Object. Which two statements are true?()AThe stub will increase network traffic.BThe Transfer Object will decrease data staleness.CThe stub will increase the logic necessary in the JSPs.DIn both cases, the JSPs can use EL expressions to get data.EOnly the Transfer Object will need to use a Business Delegate.
Friday, May 12, 2023
问题:多选题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]]}
Monday, September 16, 2024