题目内容

在exam服务目录下有verify.jsp、admin.jsp和error.jsp三个jsp页面。vrify.jsp代码如下:<%@ page contentType="text/html;charset=utf-8" %><% request.setCharacterEncoding("GB2312");String str=request.getParameter("uname");String passwd = request.getParameter("passwd");String role =request.getParameter("role");if(!passwd.equals("123321"))response.sendRedirect("error.jsp");else{if (role!=null && role.equals("admin")) {request.getRequestDispatcher("admin.jsp").forward(request,response);} else {out.print("欢迎您来到本网页!");out.print(str);}}%>error.jsp代码如下:<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%><% request.setCharacterEncoding("GB2312");String str=request.getParameter("uname");String passwd = request.getParameter("passwd");if (str !=null )out.println(str+"
");out.print("口令有错!");%>admin.jsp代码如下:<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%><%request.setCharacterEncoding("GB2312");String str=request.getParameter("uname");String role = request.getParameter("role");out.println(str+"("+role+") ");out.print("欢迎您来到本网页!");%>在浏览器地址栏内输入请求:http://localhost:8080/exam/verify.jsp?uname=www&passwd=123321&role=stu 则浏览器显示()

A. www欢迎您来到本网页!
B. www口令有错!
C. 欢迎您来到本网页!stu
D. 欢迎您来到本网页!www

查看答案
更多问题

假设JSP使用的表单中有如下GUI(复选框):软件1701班软件1702班软件1703班该表单所请求的JSP使用内置对象request获取表单提交的数据,正确的语句是:( )

A. String a=request.getParameter("banji")
B. String a=request.getParameter("checkbox")
C. String a[]=request. getParameterValues("banji")
D. String a[]=request.getParameterValues("checkbox")

如果要声明一个JSP页面局部整数变量eleCount(例如:非页面成员变量),正确的语句是:

A. <%-- Integer eleCount=0; --%>
B. <%! int eleCount=0; %>
C. <% int eleCount=0 % >
D. <% int eleCount=0; %>

以下哪个不是Java的原始数据类型:

A. int
Boolean
C. float
D. char

在Java语言中,( )表示“回车”转义字符。

A. \n
B. \r
C. \b
D. \t

答案查题题库