单项选择题
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"))
相关考题
-
单项选择题
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 -
单项选择题
WhichJSPstandardactioncanbeusedtoimportcontentfromaresourcecalledfoo.jsp?()
A.<jsp:import file=’foo.jsp’ />
B.<jsp:import page=’foo.jsp’ />
C.<jsp:include page=’foo.jsp’ />
D.<jsp:include file=’foo.jsp’ />
