单项选择题
在Servlet里,能正确获取session的语句是()。
A.HttpSession session=request.getSession(true)
B.HttpSession session=request.getHttpSession(true)
C.HttpSession session=response.getSession(true)
D.HttpSession session=response.getHttpSession(true)
点击查看答案&解析
相关考题
-
单项选择题
要设置某个JSP页面为错误处理页面,以下page指令正确的是()。
A.〈%@ page errorPage="true"%〉
B.〈%@ page isErrorPage="true"%〉
C.〈%@ page extends="javax.servlet.jsp.JspErrorPage"%〉
D.〈%@ page info="error"%〉 -
单项选择题
JAVA EE中,以下关于HttpServlet的说法错误的是()。
A.HttpServlet是一个抽象类
B.HttpServlet类扩展了GenericServlet类
C.HttpServlet类的子类必须至少重写service方法
D.HttpServlet位于javax.servlet.http包中 -
单项选择题
在Java Web应用过滤器的生命周期方法中,每当传递请求或响应时,web容器会调用()方法。
A.init
B.service
C.doFilter
D.destroy
