首先配置架包支持:
Struts架包支持:
得到struts-config.xml文件:
<struts-config>
<form-beans />
<global-exceptions />
<global-forwards />
<action-mappings />
<message-resources parameter="org.clarck.struts.ApplicationResources" />
</struts-config>
接着添加Hibernate架包支持:
配置sessionFactory文件:
<hibernate-configuration>
<session-factory>
<property name="connection.username">sa</property>
<property name="connection.url">jdbc:sqlserver://localhost:1433;databaseName=GOODS</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="myeclipse.connection.profile">sal</property>
<property name="connection.password">sasa</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
</session-factory>
</hibernate-configuration>
添加Spring架包支持:
注入sessionFactory:
导入支持文件:
添加实体类:
笔记记于:2010-9-1 12:33