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"]}
Given:
6.<% int[] nums = {42, 420, 4200};
7.request.setAttribute("foo", nums); %>
Which two successfully translate and result in a value of true?()
A.${true or false}
B.${requestScope[foo][0] > 500}
C.${requestScope[’foo’][1] = 420}
D.${(requestScope[’foo’][0] lt 50) && (3 gt 2)}
最新試題
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?
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?()
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.
Which is true about the web container request processing model?()
Your company has a corporate policy that prohibits storing a customer’s credit card number in anycorporate database. However, users have complained that they do NOT want to re- enter their credit cardnumber for each transaction. Your management has decided to use client-side cookies to record the user’scredit card number for 120 days. Furthermore, they also want to protect this information during transit fromthe web browser to the web container; so the cookie must only be transmitted over HTTPS.Which codesnippet creates the "creditCard" cookie and adds it to the out going response to be stored on the user’s webbrowser?()
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?()
Which ensures that a JSP response is of type "text/plain"?()
Click the ’Select and Place’ button.Place the events in the order they occur.