code363.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%-- 对用户名为空判断 --%>
<c:if test="${empty param.userName }">
<%
request.setAttribute("error", "用户名不能为空");
%>
<jsp:forward page="code362.jsp"></jsp:forward>
</c:if>

<%-- 对密码为空判断 --%>
<c:if test="${empty param.pwd }">
<%
request.setAttribute("error", "密码不能为空");
%>
<jsp:forward page="code362.jsp"></jsp:forward>
</c:if>

<c:choose>
<c:when test="${param.userName == 'admin' }">
<c:if test="${param.pwd == '123' }">
<jsp:forward page="code364.jsp"></jsp:forward>
</c:if>
<jsp:forward page="code365.jsp"></jsp:forward>
</c:when>
<c:otherwise>
<jsp:forward page="code365.jsp"></jsp:forward>
</c:otherwise>
</c:choose>
</body>
</html>