将Cookie保存到客户端,就是为了以后得到其中保存的数据,以下说法错误的是()
A. 调用HttpServlet'Request的getCookies()得到一个Cookie对象数组
B. 在客户端传来Cookie数据类型是数组类型,因此要得到其中某一项指定的Cookie
C. 在客户端传来的Cookie数据类型都是枚举类型,因此要得到其中一项指定的Cookie对象,需要便利数组来找
D. JSP调用rquest.getCookies()从客户端读入Cookie,getCookies()方法返回一个Http请求中的内容对应的Cookie对象;
查看答案
在web.xml文件中,有下列代码:LogFilter/*REQUESTINCLUDEHello.jsp文件的代码如下:<%@ page contentType="text/html;charset=gbk" %>登录访问Hello.jsp文件,过滤器LoginFilter过滤的文件有()。
A. Hello.jsp
B. date.jsp
C. Hello.jsp,date.jsp
D. Hello.jsp,login.jsp
为实现对test.jsp代码动作的监听,需要定义的监听器必须实现( )接口。<% getServletContext().setAttribute("username","hellking"); getServletContext().removeAttribute("username");%>
A. ServletContextListener
B. ServletContextAttributeListener
C. HttpServletContextListener
D. HttpServletContextAttributeListener
给定程序片断:<% String value = "beanvalue"; %><% request.setAttribute("com.example.been",value); %><%--插入代码处--%>在第3行插入EL表达式( ),能够计算并输出"beanvalue"。
A. ${ value }
B. ${ com.example.been beanvalue }
C. ${ requestScope["com.example.been"] }
D. ${request.getAttribute("com.example.been").toString()}
假定在web应用中,请求参数productID包含产品的标识符,下面EL表达式( )能够计算productID的值。
A. ${productID}
B. ${param.productID}
C. ${params.productID}
D. ${params.productID[1]}