<PRE class=html name=code><!DOCTYPE html PUBLIC //WC//DTD HTML Transitional//EN >
<html>
<head>
<meta httpequiv=ContentType content=text/html; charset=UTF>
<title>网络通讯录</title>
</head>
<body>
<form action=successdo method=post>
<table>
<tr><td><div>用户名:</div></td>
<td><input type=text name=username maxlength=></td>
</tr>
<tr><td><div >密码:</div></td>
<td><input type=password name=password maxlength=></td>
</tr>
</table>
<input type=submit name=Submit value=提交>
</form>
<a >没有注册请点这里</a>
</body>
</html></PRE>
DOCTYPE html PUBLIC //WC//DTD HTML Transitional//EN >
<html>
<head>
<meta httpequiv=ContentType content=text/html; charset=UTF>
<title>网络通讯录</title>
</head>
<body>
<form action=successdo method=post>
<table>
<tr><td><div>用户名:</div></td>
<td><input type=text name=username maxlength=></td>
</tr>
<tr><td><div >密码:</div></td>
<td><input type=password name=password maxlength=></td>
</tr>
</table>
<input type=submit name=Submit value=提交>
</form>
<a >没有注册请点这里</a>
</body>
</html>
<!DOCTYPE html PUBLIC //WC//DTD HTML Transitional//EN >
<html>
<head>
<meta httpequiv=ContentType content=text/html; charset=UTF>
<title>网络通讯录</title>
</head>
<body>
<form action=successdo method=post>
<table>
<tr><td><div>用户名:</div></td>
<td><input type=text name=username maxlength=></td>
</tr>
<tr><td><div >密码:</div></td>
<td><input type=password name=password maxlength=></td>
</tr>
</table>
<input type=submit name=Submit value=提交>
</form>
<a >没有注册请点这里</a>
</body>
</html>
//注册界面
//注册界面
<!DOCTYPE html PUBLIC //WC//DTD HTML Transitional//EN >
<html>
<head>
<meta httpequiv=ContentType content=text/html; charset=UTF>
<title>注册界面</title>
</head>
<body>
请填写注册信息
<form method=post action=logindo>
<table width=% border=>
<tr>
<td width=%><div align=left>请输入用户名:</div></td>
<td width=%><input name=username type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入性别:</div></td>
<td width=%><input name=sex type=text maxlength=></td>
</tr>
<tr>
<td><div align=left>请输入密码</div></td>
<td><input type=password name=password></td>
</tr>
<tr>
<td><div align=left>密码确认</div></td>
<td><input type=password name=password></td>
</tr>
<tr>
<td width=%><div align=left>请输入真实姓名:</div></td>
<td width=%><input name=realName type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入学校名称:</div></td>
<td width=%><input name=school type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入家庭地址:</div></td>
<td width=%><input name=address type=text maxlength=></td>
</tr>
<tr>
<td><div align=left>请输入电子邮件</div></td>
<td><input type=text name=email></td>
</tr>
<tr>
<td width=%><div align=left>请输入电话号码:</div></td>
<td width=%><input name=phone type=text maxlength=></td>
</tr>
</table>
<p>
<input type=submit name=submit value=提交>
<input type=reset name=submit value=重设>
</p>
<p> </p>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC //WC//DTD HTML Transitional//EN >
<html>
<head>
<meta httpequiv=ContentType content=text/html; charset=UTF>
<title>注册界面</title>
</head>
<body>
请填写注册信息
<form method=post action=logindo>
<table width=% border=>
<tr>
<td width=%><div align=left>请输入用户名:</div></td>
<td width=%><input name=username type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入性别:</div></td>
<td width=%><input name=sex type=text maxlength=></td>
</tr>
<tr>
<td><div align=left>请输入密码</div></td>
<td><input type=password name=password></td>
</tr>
<tr>
<td><div align=left>密码确认</div></td>
<td><input type=password name=password></td>
</tr>
<tr>
<td width=%><div align=left>请输入真实姓名:</div></td>
<td width=%><input name=realName type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入学校名称:</div></td>
<td width=%><input name=school type=text maxlength=></td>
</tr>
<tr>
<td width=%><div align=left>请输入家庭地址:</div></td>
<td width=%><input name=address type=text maxlength=></td>
</tr>
<tr>
<td><div align=left>请输入电子邮件</div></td>
<td><input type=text name=email></td>
</tr>
<tr>
<td width=%><div align=left>请输入电话号码:</div></td>
<td width=%><input name=phone type=text maxlength=></td>
</tr>
</table>
<p>
<input type=submit name=submit value=提交>
<input type=reset name=submit value=重设>
</p>
<p> </p>
</form>
</body>
</html>vi
<PRE class=html name=code>//下面是l文件是servlete里面对类的映射这是我对我上面那几个类的映射</PRE>
<PRE class=html name=code> </PRE>
<PRE class=html name=code><?xml version= encoding=UTF?>
<webapp xmlns:xsi=instance xmlns= xmlns:web=app__xsd xsi:schemaLocation= app__xsd id=WebApp_ID version=>
<displayname>NoteBook</displayname>
<contextparam>
<paramname>configurationfile</paramname>
<paramvalue>/WEBINF/hibernatecfgxml</paramvalue>
</contextparam>
<listener>
<listenerclass>controlSessionFactoryListener</listenerclass>
</listener>
<servlet>
<servletname>MessageView</servletname>
<servletclass>viewMessageView</servletclass>
</servlet>
<servletmapping>
<servletname>MessageView</servletname>
<urlpattern>/messagedo</urlpattern>
</servletmapping>
<servlet>
<servletname>select</servletname>
<servletclass>controlSelect</servletclass>
</servlet>
<servletmapping>
<servletname>select</servletname>
<urlpattern>/select</urlpattern>
</servletmapping>
<servlet>
<servletname>SuccessView</servletname>
<servletclass>viewSuccessView</servletclass>
</servlet>
<servletmapping>
<servletname>SuccessView</servletname>
<urlpattern>/successdo</urlpattern>
</servletmapping>
<servlet>
<servletname>Login</servletname>
<servletclass>controlLoginServlet</servletclass>
</servlet>
<servletmapping>
<servletname>Login</servletname>
<urlpattern>/logindo</urlpattern>
</servletmapping>
<welcomefilelist>
<welcomefile>l</welcomefile>
</welcomefilelist>
</webapp></PRE>
<PRE class=html name=code> </PRE>
<PRE class=html name=code>//这是hibernate的配置文档我也给大家了不过有些地方要跟自己的电脑里一样才行我用的是mysql</PRE>
<PRE class=html name=code> </PRE>
<PRE class=html name=code><PRE class=html name=code><?xml version= encoding=utf?>
<!DOCTYPE hibernateconfiguration PUBLIC
//Hibernate/Hibernate Configuration DTD //EN
configurationdtd>
<hibernateconfiguration>
<sessionfactory>
<! 设置JDBC驱动 >
<property name=connectiondriver_class>commysqljdbcDriver</property>
<! 设置数据库地址 >
<property name=connectionurl>jdbc:mysql://:/hibernate</property>
<! 数据库用户名 >
<property name=connectionusername>root</property>
<! 用户密码 >
<property name=connectionpassword>root</property>
<! 数据库方言 >
<property name=dialect>orghibernatedialectMySQLDialect</property>
<! JDBC连接池大小 >
<property name=connectionpool_size></property>
<! 二级缓沖提供者设置NoCacheProvider表示禁用二级缓沖 >
<property name=cacheprovider_class>orghibernatecacheNoCacheProvider</property>
<! 将执行的SQL输出到控制台 >
<property name=show_sql>true</property>
<! 格式化执行的SQL指令 >
<property name=format_sql>true</property>
<! 启动时自动创建数据表 >
<property name=hbmddlauto>update</property>
<mapping resource=model/userhbmxml/>
</sessionfactory>
</hibernateconfiguration></PRE>
</PRE>
<PRE class=html name=code> </PRE>