Given an HttpSession session,a ServletRequest request,and a ServletContext context,which retrieves aURL to /WEB-INF/myconfig.xml within a web application?()A、session.getResource("/WEB-INF/myconfig.xml")B、request.getResource("/WEB-INF/myconfig.xml")C、context.getResource("/WEB-INF/myconfig.xml")D、getClass().getResource("/WEB-INF/myconfig.xml")

Given an HttpSession session,a ServletRequest request,and a ServletContext context,which retrieves aURL to /WEB-INF/myconfig.xml within a web application?()

  • A、session.getResource("/WEB-INF/myconfig.xml")
  • B、request.getResource("/WEB-INF/myconfig.xml")
  • C、context.getResource("/WEB-INF/myconfig.xml")
  • D、getClass().getResource("/WEB-INF/myconfig.xml")

相关考题:

Servlet2.4以后提供了哪几种对象的事件监听?()A、ServletContext监听Servlet的会话信息B、ServletContext监听Web上下文的信息C、HttpSession监听Servlet的会话信息D、ServletRequest监听Servlet的请求信息E、HttpSession监听Web上下文的信息

J2EE中,哪个类的哪个方法用于创建对话?()A、HttpServletRequest、getSessionB、HttpServletResponse、newSessionC、HtttpSession、newInstanceD、HttpSession、getSession

对于每个要求访问maillogin.jsp的HTTP请求,Servlet容器都会创建一个HttpSession对象。

HttpSession与Hibernate中Session的区别

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?()A、Object o = pageContext.getAttribute("foo");B、Object o = pageContext.findAttribute("foo");C、Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);D、HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");

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?()A、HttpSession session = request.getSession();B、HttpSession session = request.getSession(id);C、HttpSession session = request.getSession(true);D、HttpSession session = request.getSession(false);E、HttpSession session = request.getSession("jsessionid");

J2EE中,()类的()方法用于创建对话。A、HttpServletRequest;getSessionB、HttpServletRequest;NewSessionC、HttpSession;newInstanceD、HttpSession;getSession

HttpSession失效的时机是()。A、执行invaliate()方法B、关闭浏览器C、存活时间超过setMaxInactiveInterval()方法设定的时间

下列选项中关于HttpSession描述错误的是()。A、 HttpSession通过HttpServletRequest对象获得B、 HttpSession可以用来保存数据,并实现数据的传递C、 HttpSession被创建后,将始终存在,直到服务停止D、 调用HttpSession的invalidate()方法,可以删除创建的HttpSession对象及数据

在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)

下面关于HttpSession的说法正确的是()A、Servlet容器负责创建HttpSession对象B、每个HttpSession对象都有惟一的IDC、HttpSession的数据保存在客户端D、对客户端每次请求服务器都会创建HttpSession对象

每个HttpSession对象都有惟一的ID。

session对象是HttpSession接口类的实例,由客户端负责创建和销毁。

JavaWeb应用程序必须负责为HttpSession分配惟一的ID。

关于HttpSession会话对象的属性,正确的选项是()?A、绑定到HttpSession对象上的属性在应用程序的生存期内总是有效的B、会话属性是特定用户的专用数据,同时访问WEB应用的其他用户无法访问这些属性C、使用HttpSession对象的addAttribute方法添加会话属性D、使用HttpSession对象的removeAttributeNames方法删除会话属性

HttpSession session=request.getSession(false)与HttpSession session = request.getSession(true)的区别()。A、没有区别B、如果当前reqeust中的HttpSession 为null,当传入参数为空时,就创建一个新的Session,否则返回nullC、如果当前reqeust中的HttpSession 为null,当传入参数为true时,就创建一个新的Session,否则返回null

Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()  A、 The value returned needs to be cast to an int.B、 The getAttribute methos takes two arguments.C、 Primitive CANNOT be stored in the HttpSession.D、 The HttpSession attribute name must NOT exceed eight characters.

单选题下列选项中关于HttpSession描述错误的是()。A HttpSession通过HttpServletRequest对象获得B HttpSession可以用来保存数据,并实现数据的传递C HttpSession被创建后,将始终存在,直到服务停止D 调用HttpSession的invalidate()方法,可以删除创建的HttpSession对象及数据

单选题Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()A The value returned needs to be cast to an int.B The getAttribute methos takes two arguments.C Primitive CANNOT be stored in the HttpSession.D The HttpSession attribute name must NOT exceed eight characters.

单选题关于HttpSession会话对象的属性,正确的选项是()?A绑定到HttpSession对象上的属性在应用程序的生存期内总是有效的B会话属性是特定用户的专用数据,同时访问WEB应用的其他用户无法访问这些属性C使用HttpSession对象的addAttribute方法添加会话属性D使用HttpSession对象的removeAttributeNames方法删除会话属性

多选题在Java EE中,如果req是HttpServletRequest的实例,要通过req获取已经存在的HttpSession对象,如果不存在就创建一个HttpSession对象,下面选项中()可以实现。Areq.getSession()Breq.getSession(false)Creq.getSession(true)Dreq.createSession()

判断题每个HttpSession对象都有惟一的ID。A对B错

单选题A web application uses the HttpSession mechanism to determine if a user is "logged in." When a usersupplies a valid user name and password, an HttpSession is created for that user. The user has access tothe application for only 15 minutes after logging in. The code must determine how long the user has beenlogged in, and if this time is greater than 15 minutes, must destroy the HttpSession. Which method in HttpSession is used to accomplish this?()AGetcreationtimeBInvalidateafterCGetlastaccessedtimeDGetmaxinactiveinterval

单选题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?()Asession = response.getSession();Bsession = request.getSession();Csession = request.getSession(true);Dsession = request.getSession(false);Esession = request.getSession(jsessionid);

多选题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?()AHttpSession session = request.getSession();BHttpSession session = request.getSession(id);CHttpSession session = request.getSession(true);DHttpSession session = request.getSession(false);EHttpSession session = request.getSession(jsessionid);

多选题下面关于HttpSession的说法正确的是()AServlet容器负责创建HttpSession对象B每个HttpSession对象都有惟一的IDCHttpSession的数据保存在客户端D对客户端每次请求服务器都会创建HttpSession对象

问答题HttpSession与Hibernate中Session的区别