1.sql 2.bean 3.jsp ...
1.sql
CREATE TABLE `t_admin` ( `adminId` char(32) NOT NULL, `adminname` varchar(50) DEFAULT NULL, `adminpwd` varchar(50) DEFAULT NULL, PRIMARY KEY (`adminId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2.bean
public class Admin { private String adminId;//主鍵 private String adminname;//管理員的登錄名 private String adminpwd;//管理員的登錄密碼
3.jsp
<form action="<c:url value='/AdminServlet'/>" method="post" onsubmit="return checkForm()" target="_top"> <input type="hidden" name="method" value="login"/> 管理員賬戶:<input type="text" name="adminname" value="" id="adminname"/><br/> 密 碼:<input type="password" name="adminpwd" id="adminpwd"/><br/> <input type="submit" value="進入後臺"/> </form>