1
数据库
create database student;
use student;
create table user(
id int primary key auto_increment,
user varchar(50) not null,
pwd varchar(50) not null,
name varchar(50) not null,
sex varchar(50) not null,
age int(50) not null
);
index.jsp
<%@ 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">
<html>
<head>
<base href="<%=basePath%>">
<title> 欢迎来到学生管理系统 </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">
-->
</head>
<body>
<div align="center"> <font size="+2" color="#FF6633"> 用户登录 </font>
</div>
<form id="form1" name="form1" method="post" action="loginServlet">
<table width="357" border="0" align="center">
<tr>
<td width="128"> 用户名: </td>
<td width="219"><label>
<input name="user" type="text" id="user" />
</label></td>