下面哪个表达式不能返回请求参数中的username属性值()
A: ${param.username}
B: ${param[username]}
C: ${param['username']}
D: ${param["username"]}
A: ${param.username}
B: ${param[username]}
C: ${param['username']}
D: ${param["username"]}
举一反三
- 下面是JSP项目中使用EL表达式获取作用域属性(username)值,用法正确的是( ) A: ${ username } B: $( username ) C: D: { username } E: !( username )
- 下面哪个表达式不能获取user对象的username属性( )。 A: ${user['username'] } B: ${user[username] } C: ; D: ${user.username }
- 中国大学MOOC: 阅读下面代码片段: Servlet1: request.setAttribute(username, 张三);String username=(String) request.getAttribute(username);System.out.println(username:+username);request.setAttribute(username, 李四);username=(String) request.getAttribute(username);System.out.println(username:+username);request.removeAttribute(username);username=(String) request.getAttribute(username);System.out.println(username:+username);当使用浏览器访问Servlet1时控制台会输出什么结果
- 通过表单传递参数username,servlet中如何获取参数值() A: request.getParameter(“username”); B: request.getAttribute(“username”); C: session.getAttribute(“username”); D: session.getParameter(“username”);
- 阅读下面代码片段: Servlet1: request.setAttribute("username", "张三"); String username=(String) request.getAttribute("username"); System.out.println("username:"+username); request.setAttribute("username", null); username=(String) request.getAttribute("username"); System.out.println("username:"+username); 当使用浏览器访问Servlet1时控制台会输出什么结果