单选题 Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attributein B’s request object contains the URI of the original request received by servlet A?()
REQUEST_URI
javax.servlet.forward.request_uri
javax.servlet.forward.REQUEST_URI
javax.servlet.request_dispatcher.request_uri
javax.servlet.request_dispatcher.REQUEST_URI
多选题 Which two are valid and equivalent?()
<%! int i; %>
<%= int i; %>
<jsp:expr>int i;</jsp:expr>
<jsp:scriptlet>int i;</jsp:scriptlet>
<jsp:declaration>int i;</jsp:declaration>
多选题 Which two are valid values for the element inside a element ofa web application deployment descriptor?()
NULL
SECURE
INTEGRAL
ENCRYPTED
CONFIDENTIAL
单选题 A developer is designing the presentation tier for a web application that relies on a complex session bean.The session bean is still being developed and the APIs for it are NOT finalized. Any changes to the sessionbean API directly impacts the development of the presentation tier. Which design pattern provides a meansto manage the uncertainty in the API?()
View Helper
Front Controller
Composite View
Intercepting Filter
Business Delegate
单选题 Given: 5.public class MyTagHandler extends TagSupport { 6.public int doStartTag() throws JspException { 7.try { 8.// insert code here 9.} catch(Exception ex) { /* handle exception */ } 10.return super.doStartTag(); 11.}...42. } Which code snippet, inserted at line 8,causes the value foo to be output?()
JspWriter w = pageContext.getOut();
print(foo);
JspWriter w = pageContext.getWriter();
JspWriter w = new JspWriter(pageContext.getWriter()); . w.print(foo);
多选题 Given an EL function declared with:11. 12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()
The function method must have the signature: public String spin().
The method must be mapped to the logical name spin in the web.xml file.
The function method must have the signature: public String spinIt().
The function method must have the signature public static String spin().
The function method must have the signature: public static String spinIt().
The function class must be named Spinner, and must be in the package com.example.
多选题 A developer wants a web application to be notified when the application is about to be shut down. Which two actions are necessary to accomplish this goal?()
Include a listener directive in a JSP page
configure a listener in the TLD file using the
Include a
configure a listener in the application deployment descriptor, using the
Include a class implementing ServletContextListener as part of the web application deploymen
多选题 Given: http://com.example/myServlet.jsp?num=one&num=two&num=three. Which two produce the output"one, two and three"?()
${param.num[0],[1] and [2]}
${paramValues[0],[1] and [2]}
${param.num[0]}, ${param.num[1]} and ${param.num[2]}
${paramValues.num[0]}, ${paramValues.num[1]} and ${paramValues.num[2]}
${paramValues[num][0]}, ${paramValues[num][1]} and ${paramValues[num][2]}
单选题 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?()
Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
单选题 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 href=’mailto:${footerEmail}’>Contact me</a>
<a href=’mailto:${initParam@footerEmail}’>Contact me</a>
<a href=’mailto:${initParam.footerEmail}’>Contact me</a>
<a href=’mailto:${contextParam@footerEmail}’>Contact me</a>
<a href=’mailto:${contextParam.footerEmail}’>Contact me</a>