Cookie对象可以通过setAttribute()方法设置,通过getAttribute()方法读取。
错
举一反三
- 在作用域对象上设置属性的方法是getAttribute(),获取属性的方法是setAttribute()。
- 哪个方法可以设置元素节点的属性 A: getAttribute() B: setAttr() C: setAttribute() D: getAttr()
- 中国大学MOOC: Application对象通过 setAttribute方法来保存信息,通过getAttribute方法来获取信息。
- Application对象通过 setAttribute方法来保存信息,通过getAttribute方法来获取信息。 A: 正确 B: 错误
- 通过调用request对象的getParameter方法返回的数据类型为;通过调用session对象的getAttribute方法返回的数据类型为;通过调用application对象的getAttribute方法返回的数据类型为。
内容
- 0
使用config对象的()方法可以获取web.xml文件中的初始化参数. A: getParameter B: setAttribute C: getAttribute D: getInitParameter
- 1
关于HttpSession的getAttribute()和setAttribute()方法,正确的说法是______。 A: getAttribute()方法返回类型是String B: getAttribute()方法返回类型是Object C: setAttribute()方法保存数据时如果名字重复会抛出异常 D: setAttribute()方法保存数据时如果名字重复会覆盖以前的数据
- 2
可以当做容器使用,通过getAttribute()方法和getAttribute()方法存入、取出数据的内置对象有() A: request B: response C: session D: out E: application
- 3
使用response对象进行重定向时,使用的方法是()。 A: getAttribute B: setContentType C: sendRedirect D: setAttribute
- 4
使用response对象进行重定向时使用的方法为( )。 A: getAttribute( ) B: sendRedirect( ) C: setContentType( ) D: setAttribute( )