Struts 2.0 Consolidated Hibernate 3.2 Development Register Login System

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.