單項選擇題

Given:
10.public void service(ServletRequest request,
11.ServletResponse response) {
12.ServletInputStream sis =
13.// insert code here
14.}
Which retrieves the binary input stream on line 13?()

A.request.getWriter();
B.request.getReader();
C.request.getInputStream();
D.request.getResourceAsStream();


您可能感興趣的試卷

你可能感興趣的試題

2.多項選擇題

You are creating a servlet that generates stock market graphs. You want to provide the web browser withprecise information about the amount of data being sent in the response stream. 
Which twoHttpServletResponse methods will you use to provide this information?()

A.response.setLength(numberOfBytes);
B.response.setContentLength(numberOfBytes);
C.response.setHeader("Length", numberOfBytes);
D.response.setIntHeader("Length", numberOfBytes);
E.response.setHeader("Content-Length", numberOfBytes);
F.response.setIntHeader("Content-Length", numberOfBytes);

4.單項選擇題Given an HttpServletRequest request and HttpServletResponse response,which sets a cookie "username"with the value "joe" in a servlet?()

A.request.addCookie("username", "joe")
B.request.setCookie("username", "joe")
C.response.addCookie("username", "joe")
D.request.addHeader(new Cookie("username", "joe"))
E.request.addCookie(new Cookie("username", "joe"))
F.response.addCookie(new Cookie("username", "joe"))

5.單項選擇題

You need to create a JavaBean object that is used only within the current JSP page. It must NOT beaccessible to any other page including those that this page might import.
Which JSP standard action canaccomplish this goal?()

A.<jsp:useBean id=’pageBean’ type=’com.example.MyBean’ />
B.<jsp:useBean id=’pageBean’ class=’com.example.MyBean’ />
C.<jsp:makeBean id=’pageBean’ type=’com.example.MyBean’ />
D.<jsp:makeBean id=’pageBean’ class=’com.example.MyBean’ />

最新試題

In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()

題型:多項選擇題

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

題型:單項選擇題

Which two are valid and equivalent?()

題型:多項選擇題

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

題型:單項選擇題

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.

題型:問答題

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.

題型:問答題

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

題型:問答題