Development tools: MyEclipse 6.0, Tomcat 5.5, JDK 1.5, MySQL 5.0; Development preparation: Download Struts 2.0 and Hibernate 3.2, and you can download both frames on the official website of struts and Hibernate. Let's take a look at the package-class diagram after the development is complete:
First, new web Project, called "Loginsystem," adds struts 2.0 jar packages and Hibernate 3.2 jar packages to the Lib directory, and then follows these steps:
1, under the SRC directory to build "Hibernate.cfg.xml" all the code as follows:
<?xml version= ' 1.0 ' encoding= ' UTF-8 '?>
2<! DOCTYPE hibernate-configuration Public
3 "-//hibernate/hibernate Configuration DTD 3.0//en"
4 "HTTP://HIBERNATE.SOURCEFORGE.NET/HIBERNATE-CONFIGURATION-3.0.DTD" >
5
6<!--generated by MyEclipse Hibernate Tools. -->
78 <session-factory>
9 <property name= "Connection.username" >root</property>
<property name= "Connection.url" >
One Jdbc:mysql://localhost:3306/loginsystem
</property>
<property name= "dialect" >
Org.hibernate.dialect.MySQLDialect
</property>
<property name= "Myeclipse.connection.profile" >
Loginsystem
</property>
<property name= "Connection.password" >root</property>
<property name= "Connection.driver_class" >
Com.mysql.jdbc.Driver
</property>
<property name= "Show_sql" >true</property>
<!--Pojo class mapping configuration-->
<mapping resource= "Com/rong/orm/user.hbm.xml"/>
Num </session-factory>
27