A.The tag handler must implement BodyTag.
B.The doAfterBody method is NOT called.
C.The setBodyContent method is called once.
D.It is never legal to return EVAL_BODY_BUFFERED from doStartTag.
您可能感興趣的試卷
你可能感興趣的試題
Assume the tag handler for a st:simple tag extends Simple Tag Support.
In what way can scriptlet code beused in the body of st:simple?()
A.Set the body content type to JSP in the TLD
B.Scriptlet code is NOT legal in the body of st:simple.
C.Add scripting-enabled="true" to the start tag for the st:simple element
D.Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and place the scriptlet code in the body of that tag
Given:
11.<% java.util.Map map = new java.util.HashMap();
12.request.setAttribute("map", map);
13.map.put("a", "b");
14.map.put("b", "c");
15.map.put("c", "d"); %>
16.<%-- insert code here --%>
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 are building a dating web site. The client’s date of birth is collected along with lots of other information.You have created an EL function with the signature:
calcAge(java.util.Date):int and it is assigned to the name, age, in the namespace, funct. In one of your JSPsyou need to print a special message to clients who are younger than 25.
Which EL code snippet will returntrue for this condition?()
A.${calcAge(client.birthDate) < 25}
B.${calcAge[client.birthDate] < 25}
C.${funct:age(client.birthDate) < 25}
D.${funct:age[client.birthDate] < 25}
E.${funct:calcAge(client.birthDate) < 25}
You are creating an error page that provides a user-friendly screen whenever a server exception occurs.You want to hide the stack trace, but you do want to provide the exception’s error message to the user sothe user can provide it to the customer service agent at your company.
Which EL code snippet inserts thiserror message into the error page?()
A.Message: <b>${exception.message}</b>
B.Message: <b>${exception.errorMessage}</b>
C.Message: <b>${request.exception.message}</b>
D.Message: <b>${pageContext.exception.message}</b>
E.Message: <b>${request.exception.errorMessage}</b>
Click the Exhibit button.
Given:
11.<% com.example.Advisor advisor = new com.example.Advisor(); %>
12.<% request.setAttribute("foo", advisor); %>
Assuming there are no other "foo" attributes in the web application,which three are valid EL expressions forretrieving the advice property of advisor?()
A.${foo.advice}
B.${request.foo.advice}
C.${requestScope.foo.advice}
D.${requestScope[foo[advice]]}
E.${requestScope["foo"]["advice"]}
最新試題
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?()
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?()
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? ()
All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:42.<context-param>43.<param-name>webmasterEmail</param-name>44.<param-value>master@example.com</param-value>45.</context-param>Which JSP code snippet creates this email link?()
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.
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?()
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 <title> tag that requires the page name tobe specified dynamically when the header is imported.Which JSP code snippet performs the import of theheader content?()
In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()
Click the ’Select and Place’ button.Place the events in the order they occur.