ServletContext接口的()方法用于将对象保存到Servlet上下文中?选一项
A: getServletContext()
B: getContext()
C: getAttribute()
D: setAttribute()
A: getServletContext()
B: getContext()
C: getAttribute()
D: setAttribute()
举一反三
- 下面方法中,用于获取ServletContext对象的方法是 A: getServletConfig().getServletContext() B: getServletContext() C: getServlet().getServletContext() D: response.getServletContext()
- 通过ServletConfig对象的getServletContext()方法,不能获取Servlet所在的应用上下文对象。
- ServletContext定义与属性相关的方法是哪三个()。 A: getAttribute() B: setAttribute() C: deleteAttribute() D: removeAttribute()
- 下述有关ServletContext对象的说法正确的是_____。 A: ServletContext对象表示当前Servlet的上下文环境,每个Servlet拥有独立的ServletContext对象 B: ServletContext对象拥有与HttpServletRequest对象名称和作用域都相同的域属性设置方法 C: ServletContext对象可以获取当前应用以及应用所运行的容器的相关信息 D: ServletContext对象的getInitParameter()方法可以获取当前Servlet的初始化参数
- 关于HttpSession的getAttribute()和setAttribute()方法,正确的说法是______。 A: getAttribute()方法返回类型是String B: getAttribute()方法返回类型是Object C: setAttribute()方法保存数据时如果名字重复会抛出异常 D: setAttribute()方法保存数据时如果名字重复会覆盖以前的数据