<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" >
<title>my JSP ' login.jsp ' starting page</title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This is my page" >
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" >
-
<script type= "Text/javascript" >
function Login () {
var form = document.forms[0];
Form.action = "<%=basepath%>user/login";
Form.method = "POST";
Form.submit ();
}
</script>
<body>
<form action= "" Name= "LoginForm" >
User name: <input type= "text" name= "username" id= "username"
Placeholder= "Please enter account" required= "required"/>
<font color= "Red" >${unameerr}</font>
<br/>
Password: <input type= "password" name= "pwd" id= "pwd"
Placeholder= "Please enter the password" required= "required"/>
<font color= "Red" >${pwderr}</font>
<br/>
<input type= "button" value= "Login" onclick= "login ()"/>
</form>
</body>
Create a simple login interface with Java