📄 index.jsp
字号:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="./tags.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login</title>
</head>
<script language="javascript">
function formSubmit(method){
document.forms[0].action='<%=request.getContextPath()%>/Login?method=' + method ;
return true;
}
</script>
<body>
<br>
<br>
<table align="center">
<tr>
<td><span style="text-align: center;"><font
style="font: bold; font-size: xx-large; text-align: center;">Welcome
to CQ Message System</font></span></td>
</tr>
</table>
<c:if test="${userName != null}">
<table align="right">
<tr>
<td style="font-size: x-small; font-weight: lighter;">Welcome <c:out
value="${userName}" /><a
href="<%=request.getContextPath()%>/User?method=logout"> Logout</a></td>
</tr>
</table>
</c:if>
<br>
<hr>
<!-- Login form -->
<form action="" method="post">
<table align="center" border="1"
style="font-weight: lighter; font-size: x-small;">
<tr>
<td colspan="2" align="center">User login</td>
</tr>
<tr>
<td>Name:</td>
<td><input name="userName" type="text" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="userPassword" type="password" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="radio" name="uType"
value="Admin"
<c:if test ="${uType == 'Admin' }" ><c:out value="checked=\"checked\" " /> </c:if>>Admin
<input type="radio" name="uType" value="Common User"
<c:if test ="${uType=='null' || uType != 'Admin' }" ><c:out value="checked=\"checked\" " /> </c:if>>Common
User</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit"
value="Submit" onclick="formSubmit('submit')" /> <input
type="submit" value="Register" onclick="formSubmit('register')" /></td>
</tr>
</table>
<!-- show error when necessery -->
<table border="0" align="center">
<tr>
<td style="color: red;"><c:if test="${error != null}">
<c:out value="${error }" />
</c:if></td>
</tr>
</table>
</form>
<jsp:include page="./footer.jsp"></jsp:include>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -