接上篇文章,这里是用HTML编写的几个固定界面

 
//我的HTML不专业,写得不够好,很难看,呵呵.下面是登录界面.
<!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=UTF-8">

<title>网络通讯录</title>

</head>

<body>

	<form action="success.do" method="post">

		<table>

			<tr><td><div>用户名:</div></td>

				<td><input type="text" name="username" maxlength="10"></td>

			</tr>

			<tr><td><div >密码:</div></td>

				<td><input type="password" name="password" maxlength="10"></td>

			</tr>

		</table>

		<input type="submit" name="Submit" value="提交">

	</form>

	<a href="register.html">没有注册请点这里</a>

</body>

</html>
//注册界面
<!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=UTF-8">

<title>注册界面</title>

</head>

<body>

请填写注册信息

<form method="post" action="login.do">

	<table width="75%" border="1">

    <tr> 

      <td width="24%"><div align="left">请输入用户名:</div></td>

      <td width="76%"><input name="username" type="text" maxlength="10"></td>

    </tr>

    <tr>

    	<td width="24%"><div align="left">请输入性别:</div></td>

      <td width="76%"><input name="sex" type="text" maxlength="10"></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="24%"><div align="left">请输入真实姓名:</div></td>

      <td width="76%"><input name="realName" type="text" maxlength="10"></td>

    </tr>

    <tr> 

      <td width="24%"><div align="left">请输入学校名称:</div></td>

      <td width="76%"><input name="school" type="text" maxlength="50"></td>

    </tr>

    <tr> 

      <td width="24%"><div align="left">请输入家庭地址:</div></td>

      <td width="76%"><input name="address" type="text" maxlength="10"></td>

    </tr>

    <tr> 

      <td><div align="left">请输入电子邮件:</div></td>

      <td><input type="text" name="email"></td>

    </tr>

    <tr> 

      <td width="24%"><div align="left">请输入电话号码:</div></td>

      <td width="76%"><input name="phone" type="text" maxlength="20"></td>

    </tr>

    

    

  </table>

  <p> 

    <input type="submit" name="submit" value="提交">

    <input type="reset" name="submit2" value="重设">

   

  </p>

  <p> </p>

</form>

</body>

</html>
//下面是web.html文件,是servlete里面对类的映射,这是我对我上面那几个类的映射
 
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

  <display-name>NoteBook</display-name>

  <context-param>

		<param-name>configuration-file</param-name>

		<param-value>/WEB-INF/hibernate.cfg.xml</param-value>

	</context-param>

	

	<listener>

		<listener-class>control.SessionFactoryListener</listener-class>

	</listener>

	<servlet>

		<servlet-name>MessageView</servlet-name>

		<servlet-class>view.MessageView</servlet-class>

	</servlet>

	<servlet-mapping>

		<servlet-name>MessageView</servlet-name>

		<url-pattern>/message.do</url-pattern>

	</servlet-mapping>

	<servlet>

		<servlet-name>select</servlet-name>

		<servlet-class>control.Select</servlet-class>

	</servlet>

	<servlet-mapping>

		<servlet-name>select</servlet-name>

		<url-pattern>/select</url-pattern>

	</servlet-mapping>



	<servlet>

		<servlet-name>SuccessView</servlet-name>

		<servlet-class>view.SuccessView</servlet-class>

	</servlet>

	<servlet-mapping>

		<servlet-name>SuccessView</servlet-name>

		<url-pattern>/success.do</url-pattern>

	</servlet-mapping>

	<servlet>

		<servlet-name>Login</servlet-name>

		<servlet-class>control.LoginServlet</servlet-class>

	</servlet>

	<servlet-mapping>

		<servlet-name>Login</servlet-name>

		<url-pattern>/login.do</url-pattern>

	</servlet-mapping>

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

    

  </welcome-file-list>

</web-app>
 
//这是hibernate的配置文档,我也给大家了,不过有些地方要跟自己的电脑里一样才行,我用的是mysql
 
<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE hibernate-configuration PUBLIC

        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">



<hibernate-configuration>



    <session-factory>

    	<!-- 设置JDBC驱动 -->

        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>

        <!-- 设置数据库地址 -->

        <property name="connection.url">jdbc:mysql://127.0.0.1:3306/hibernate</property>

        <!-- 数据库用户名 -->

        <property name="connection.username">root</property>

        <!-- 用户密码 -->

        <property name="connection.password">root</property>

        <!-- 数据库方言 -->

        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <!-- JDBC连接池大小 -->

        <property name="connection.pool_size">5</property>

        <!-- 二级缓冲提供者设置:NoCacheProvider表示禁用二级缓冲  -->

        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>



        <!-- 将执行的SQL输出到控制台 -->

        <property name="show_sql">true</property>

        <!-- 格式化执行的SQL指令 -->

        <property name="format_sql">true</property>

        <!-- 启动时自动创建数据表 -->

        <property name="hbm2ddl.auto">update</property>

        

        <mapping resource="model/user.hbm.xml"/>

    </session-factory>



</hibernate-configuration>
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值