單項(xiàng)選擇題

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?()

A.JspWriter w = pageContext.getOut();
B.print("foo");
C.JspWriter w = pageContext.getWriter();
D.JspWriter w = new JspWriter(pageContext.getWriter()); . w.print("foo");



您可能感興趣的試卷

你可能感興趣的試題

2.多項(xiàng)選擇題

Given an EL function declared with:11. <function>
12.<name>spin</name>
13.<function-class>com.example.Spinner</function-class>
14.<function-signature>
15.java.lang.String spinIt()
16.</function-signature>
17.</function>
Which two are true?()

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 the signature public static String spin().
E.The function method must have the signature: public static String spinIt().
F.The function class must be named Spinner, and must be in the package com.example.

4.多項(xiàng)選擇題

Given: http://com.example/myServlet.jsp?num=one&num=two&num=three.
Which two produce the output"one, two and three"?()

A.${param.num[0],[1] and [2]}
B.${paramValues[0],[1] and [2]}
C.${param.num[0]}, ${param.num[1]} and ${param.num[2]}
D.${paramValues.num[0]}, ${paramValues.num[1]} and ${paramValues.num[2]}
E.${paramValues["num"][0]}, ${paramValues["num"][1]} and ${paramValues["num"][2]}

最新試題

Which three are true about servlet filters?()

題型:多項(xiàng)選擇題

You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, 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: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date)Which EL code snippet will generate the string for the previousweek?

題型:單項(xiàng)選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:問答題

Click the 'Select and Place' button.Place the events in the order they occur.

題型:問答題

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?()

題型:單項(xiàng)選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:問答題

Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()

題型:單項(xiàng)選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:問答題

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 thedate of birth and today’s date. In one of your JSPs you need to print a special message to clients within theage group of 25 through 35.Which two EL code snippets will return true for this condition? ()

題型:多項(xiàng)選擇題

Click the 'Select and Place' button.Place the events in the order they occur.

題型:問答題