在public HttpSession getSession(boolean bool)的方法定义中,当bool为false时表明()
第1题:
J2EE中,哪个类的哪个方法用于创建对话?()
第2题:
Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()
第3题:
Given the definition of MyServlet: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.HttpSession session = request.getSession(); 16.session.setAttribute("myAttribute","myAttributeValue"); 17.session.invalidate(); 18.response.getWriter().println("value=" + 19.session.getAttribute("myAttribute")); 20.} 21.} What is the result when a request is sent to MyServlet?()
第4题:
Upon a user’s first visit to the website, which two operations are always performed when the getSession method is called with no arguments in a servlet?()
第5题:
在Java EE中,如果req是HttpServletRequest的实例,要通过req获取已经存在的HttpSession对象,如果不存在就创建一个HttpSession对象,下面选项中()可以实现。
第6题:
下列哪种方式可以在session中保存一个名为"name",值为"newer"的属性()
第7题:
下面关于HttpSession的说法正确的是()
第8题:
HttpSession通过HttpServletRequest对象获得
HttpSession可以用来保存数据,并实现数据的传递
HttpSession被创建后,将始终存在,直到服务停止
调用HttpSession的invalidate()方法,可以删除创建的HttpSession对象及数据
第9题:
req.getSession()
req.getSession(false)
req.getSession(true)
req.createSession()
第10题:
All URLs returned by the server are rewritten.
An HttpSession object is created if necessary.
The user name and password of the user are checked.
The session ID is stored in the HTTP response as a cookie.
第11题:
HttpServletRequest类的getSession方法有两个:带参数的getSession方法和不带参数的getSession方法
在Servlet中,可以使用HttpSession session = new HttpSession()创建session对象
如果HttpServletRequest类的getSession方法的参数为false,表示如果没有与当前的请求相联系的会话对象时,该方法返回null
如果HttpServletRequest类的getSession方法的参数为true,表示如果没有与当前的请求相联系的会话对象时,该方法返回null
第12题:
An IllegalStateException is thrown at runtime.
An InvalidSessionException is thrown at runtime.
The string value=null appears in the response stream.
The string value=myAttributeValue appears in the response stream.
第13题:
在J2EE中,对于在Servlet如何获得会话,描述正确的是()。
第14题:
Given an HttpServletRequest request and an HttpServletResponse response: 41.HttpSession session = null; 42.// insert code here 43.if(session == null) { 44.// do something if session does not exist 45.} else { 46.// do something if session exists47. } To implement the design intent,which statement must be inserted at line 42?()
第15题:
Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()
第16题:
J2EE中,()类的()方法用于创建对话。
第17题:
下列选项中关于HttpSession描述错误的是()。
第18题:
在Servlet里,能正确获取session的语句是()。
第19题:
HttpSession session=request.getSession(false)与HttpSession session = request.getSession(true)的区别()。
第20题:
直接返回会话对象
当服务器已经创建了会话对象就返回该对象,否则返回null
直接返回null
当服务器已经创建了会话对象就返回该对象,否则新建一个会话对象并返回
第21题:
session = response.getSession();
session = request.getSession();
session = request.getSession(true);
session = request.getSession(false);
session = request.getSession(jsessionid);
第22题:
HttpSession session = request.getSession();
HttpSession session = request.getSession(id);
HttpSession session = request.getSession(true);
HttpSession session = request.getSession(false);
HttpSession session = request.getSession(jsessionid);
第23题:
request.getSession().setAttribute(“name”,newer)
request.getSession().getAttribute(“ID”,id);
request.getSession().setParameter(“ID”,id);
request.getSession().getParameter(“ID”,id)