网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
在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)
参考答案
参考解析
解析:
暂无解析
更多 “单选题在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)” 相关考题
考题
在Servlet中,下列语句可以正确获取PrintWriter对象的是()
A.PrintWriterout=request.getWriter();B.PrintWriterout=request.getPrinteWriter();C.PrintWriterout=response.getWriter();D.PrintWriterout=responce.getPrinteWriter();
考题
Jsp内嵌对象session的类型为javax.servlet.http.HttpSession,下述语句会使该对象失效的是()
A.session.dispose()B.session.clear()C.session.invalidate()D.session.removeAll()
考题
在Servlet里,能正确获取session的语句是()。
A、HttpSessionsession=request.getSession(true)B、HttpSessionsession=request.getHttpSession(true)C、HttpSessionsession=response.getSession(true)D、HttpSessionsession=response.getHttpSession(true)
考题
假设现在已经利用session对象把变量a赋值为hello,那么下列语句中能显示出“hello”的是______。A.<%=session("a")%>B.<%=session"a"%>C.<%=session(a)%>D.<%=session: a%>
考题
下列定义Session变量的语句中,正确的是()。A、% Session(” name ”)= Tom %B、% Session(name )= ” Tom ” % C、%Session(name )= Tom % D、% Session(” name ”)= ” Tom ” %
考题
在Servlet里,能实现跳转的方法有()。A、运用javax.servlet.http.HttpServletRequest接口的sendRedirect方法B、运用javax.servlet.http.HttpServletResponse接口的sendRedirect方法C、运用javax.servlet.RequestDispatcher接口的forward方法D、运用javax.servlet.ResponseDispatcher接口的forward方法
考题
如果要把一个用户名jack保存在session对象里,则下列语句正确的是()。A、 session.setAttribute( name, jack );B、 session.setAttribute(“ name” , “jack”);C、 session.setAttribute( “jack”, “ name” );D、 session.setAttribute(“jack”, name );
考题
Which interface must a class implement to be informed of a session creation event?()A、 javax.servlet.http.HttpSessionListenerB、 javax.servlet.http.HttpSessionBindingListenerC、 javax.servlet.http.HttpSessionCreationListenerD、 javax.servlet.http.HttpSessionActivationListener
考题
Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()A、javax.servlet.http.HttpSessionListenerB、javax.servlet.http.HttpSessionValueListenerC、javax.servlet.http.HttpSessionBindingListenerD、javax.servlet.http.HttpSessionAttributeListener
考题
下面哪个有关Servlet中init()操作的说法不正确的是:()A、在Servlet实例化之后,Servlet容器会调用init()方法。B、Servlet 通过init()方法可以实现一些初始化工作,如建立数据库连接,获取配置信息等C、init()方法可以被多次调用
考题
关于Servlet/JSP的Session ID,()是正确。A、预设使用Cookie来储存Session IDB、Cookie的名称是JSESSION IDC、在禁用Cookie时,可以使用URL重写来发送Session IDD、必须自行呼叫HttpSession的getId()方可产生
考题
关于ServletContext说法正确的是()A、是一个Web应用程序的上下文环境B、一个Servlet在ServletContext上设置属性可以被其他Servlet所共享C、可以获取Servlet的配置信息D、可以获取整个应用程序的初始化参数
考题
在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)
考题
Servlet的生命周期接口由下列哪个对象定义?()A、javax.servlet.http.HttpServletB、javax.servlet.http.HttpSessionC、javax.servlet.ServletD、javax.servlet.Session
考题
Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()A、javax.servlet.http.HttpSessionListenerB、javax.servlet.http.HttpSessionBindingListenerC、javax.servlet.http.HttpSessionAttributeListenerD、javax.servlet.http.HttpSessionActivationListener
考题
For which three events can web application event listeners be registered?()A、When a session is createdB、After a servlet is destroyedC、When a session has timed outD、When a cookie has been createdE、When a servlet has forwarded a requestF、When a session attribute value is changed
考题
多选题关于ServletContext说法正确的是()A是一个Web应用程序的上下文环境B一个Servlet在ServletContext上设置属性可以被其他Servlet所共享C可以获取Servlet的配置信息D可以获取整个应用程序的初始化参数
考题
单选题Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()A
javax.servlet.http.HttpSessionListenerB
javax.servlet.http.HttpSessionBindingListenerC
javax.servlet.http.HttpSessionAttributeListenerD
javax.servlet.http.HttpSessionActivationListener
考题
多选题关于Servlet/JSP的Session ID,()是正确。A预设使用Cookie来储存Session IDBCookie的名称是JSESSION IDC在禁用Cookie时,可以使用URL重写来发送Session IDD必须自行呼叫HttpSession的getId()方可产生
考题
单选题如果要把一个用户名jack保存在session对象里,则下列语句正确的是()。A
session.setAttribute( name, jack );B
session.setAttribute(“ name” , “jack”);C
session.setAttribute( “jack”, “ name” );D
session.setAttribute(“jack”, name );
考题
单选题Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()A
javax.servlet.http.HttpSessionListenerB
javax.servlet.http.HttpSessionValueListenerC
javax.servlet.http.HttpSessionBindingListenerD
javax.servlet.http.HttpSessionAttributeListener
考题
单选题JSP内嵌对象session的类型为javax.servlet.http.HttpSession,下述语句会使该对象失效的是()。A
session.dispose();B
session.clear();C
session.invalidate();D
session.removeAll();
考题
多选题For which three events can web application event listeners be registered? ()Awhen a session is createdBafter a servlet is destroyedCwhen a session has timed outDwhen a cookie has been createdEwhen a servlet has forwarded a requestFwhen a session attribute value is changed
考题
单选题在Servlet中,下列语句可以正确获取PrintWriter对象的是()A
PrintWriter out = request.getWriter();B
PrintWriter out = request.getPrinteWriter();C
PrintWriter out = response.getWriter();D
PrintWriter out = responce.getPrinteWriter();
考题
单选题在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)
考题
单选题Which interface must a class implement to be informed of a session creation event?()A
javax.servlet.http.HttpSessionListenerB
javax.servlet.http.HttpSessionBindingListenerC
javax.servlet.http.HttpSessionCreationListenerD
javax.servlet.http.HttpSessionActivationListener
考题
单选题Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()A
javax.servlet.http.HttpSessionListenerB
javax.servlet.http.HttpSessionValueListenerC
javax.servlet.http.HttpSessionBindingListenerD
javax.servlet.http.HttpSessionAttributeListener
考题
单选题Servlet的生命周期接口由下列哪个对象定义?()A
javax.servlet.http.HttpServletB
javax.servlet.http.HttpSessionC
javax.servlet.ServletD
javax.servlet.Session
热门标签
最新试卷