http://www.blogjava.net/rongxh7/archive/2009/03/31/239769.html 开发工具:MyEclipse 6.0 ,Tomcat 5.5 ,JDK 1.5 ,MySQL 5.0 ;开发准备:下载Struts 2.0和Hibernate 3.2,大家可Struts和Hibernate的官方网站下载这两个框架。我们先来总览一下开发完成后的包—类图: 首先NEW一个Web Project ,名为”LoginSystem” ,在 lib 目录下加入Struts 2.0的Jar包和Hibernate 3.2的Jar包,然后按下面的步骤来: 1、在 src 目录下建 “hibernate.cfg.xml” 全部代码如下: 1<?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. –> 7<hibernate-configuration> 8 <session-factory> 9 <property name=”connection.username”>root</property> 10 <property name=”connection.url”> 11 jdbc:mysql://localhost:3306/LoginSystem 12 </property> 13 <property name=”dialect”> 14 org.hibernate.dialect.MySQLDialect 15 </property> 16 <property name=”myeclipse.connection.profile”> 17 LoginSystem 18 </property> 19 <property name=”connection.password”>root</property> 20 [...]