多项选择题
以下能够操作Session中数据的方法有()
A.向session中存入数据setAttribute(String name,Object value)
B.从session中获取数据getAttribute(String name)
C.从session中移除数据removeAttribute(String name)
D.从Session中获取数据getParameterByName(String name)
E.覆盖session中已有数据:setAttribute(String name,Object value)name为已有的key
相关考题
-
多项选择题
以下能操作Cookie的方法是()
A.获得Cookie的名称:getName()
B.获得Cookie的值:getValue()
C.设置Cookie有效域名:setDomain(String pattern)
D.设置Cookie的有效时长:setMaxAge(int expiry)
E.设置Cookie的有效路径:setPath(String path) -
多项选择题
以下对Cookie说法正确的是()
A.Cookie技术是客户端的会话技术。
B.Cookie技术把数据保存的浏览器客户端。
C.向服务器发送请求会携带Cookie中的数据。
D.Cookie技术把数据保存到服务器端。
E.Cookie存储的数据大小是没有限制的。 -
多项选择题
如果希望用户在访问完Servlet1后可以显示web应用目录下的index.jsp页面,且浏览器地址栏改变为index.jsp,在Servlet1中如下哪种代码可以实现?(web应用名为app)()
A.response.setHeader("Refresh","0;url=/app/index.jsp");
B.response.setStatus(302);response.setHeader("Location","/index.jsp");
C.response.sendRedirect(request.getContextPath()+“/index.jsp”);
D.request.getRequestDispatcher(“/index.jsp”).forward(request,response);
E.request.getRequestDispatcher(“/app/index.jsp”).forward(request,response);