單項選擇題

You need to retrieve the username cookie from an HTTP request. If this cookie does NOT exist, then the cvariable will be null.
Which code snippet must be used to retrieve this cookie object?()

A.
B.
C.
D.


您可能感興趣的試卷

你可能感興趣的試題

1.多項選擇題

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);

3.單項選擇題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"))

4.單項選擇題

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’ />

最新試題

Which is a benefit of precompiling 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?()

題型:單項選擇題

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 a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies:20.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname.Which EL code snippet will display Nth element of the user’s selected hobbies?()

題型:單項選擇題

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

題型:問答題

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.

題型:問答題