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.
您可能感興趣的試卷
你可能感興趣的試題
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);
Your web page includes a Java SE v1.5 applet with the following declaration:
11.<object classid=’clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA’
12.width=’200’ height=’200’>
13.<param name=’code’ value=’Applet.class’ />
14.</object>
Which HTTP method is used to retrieve the applet code?()
A.GET
B.PUT
C.POST
D.RETRIEVE
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"))
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’ />
A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page.
Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()
A.id
B.name
C.bean
D.type
E.scope
最新試題
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.