已知表单有一个参数名为“userName”的参数,提交后,能够正确获得表单对象值的代码是?()
A: request.getParameter(“userName”);
B: response.getParameter(“userName”);
C: request.getParameter(“username”);
D: request.getParameterValues(“userName”);
A: request.getParameter(“userName”);
B: response.getParameter(“userName”);
C: request.getParameter(“username”);
D: request.getParameterValues(“userName”);
举一反三
- 在login.html中存在如下代码:username:当表单提交时,能够得到文本框的值的是( ) A: request.getAttribute(“userName”) B: request.getParameter(“myName”) C: request. getParameter(“userName”) D: request.getAttribute(“myName”)
- 以下表单提交后,在1.jsp中获取userName的值,最合适的方法是()JavaCWeb A: Stringname=request.getAttribute("userName"); B: Stringname=request.getParameter("userName"); C: String[]names=request.getParameter("userName"); D: String[]names=request.getParameterValues("userName");
- 通过表单传递参数username,servlet中如何获取参数值() A: request.getParameter(“username”); B: request.getAttribute(“username”); C: session.getAttribute(“username”); D: session.getParameter(“username”);
- 在login.html中存在如下代码username: A: oginservlet中获得文本框的值正确的是: B: 无法获取,因为代码在Html中 C: request.getAttribute(“userName”) D: request.getParameter(“myName”) E: request.getParameter(“userName”)
- 在login.html中存在如下代码<;formaction=”/logindemo/login”>;username:<;inputtype=’text’name=’userName’id=’myName’value=’yourname’>;<;/form>;在loginservlet中获得文本框的值正确的是:() A: 无法获取,因为代码在Html中 B: request.getAttribute("userName") C: request.getParameter("myName") D: request.getParameter("userName")