如何搭建SSH框架,myeclipse搭建SSH框架详解
2016-06-03 · 百度知道合伙人官方认证企业
myeclipse搭建SSH框架详解:
1、创建一个工程sshDemo
2、加入hibernate capabilities:
3、选中add the libraries to the project和select to create a new hibernate mapping file这两项
4、添加Add Struts Capabilityies:
5、启动struts支持
6、配置spring:CustomerBean.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="customerAction" class="com.mkyong.customer.action.CustomerAction">
<property name="customerBo" ref="customerBo" />
</bean>
<bean id="customerBo" class="com.mkyong.customer.bo.impl.CustomerBoImpl" >
<property name="customerDAO" ref="customerDAO" />
</bean>
<bean id="customerDAO" class="com.mkyong.customer.dao.impl.CustomerDAOImpl" >
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>