- 添加spring支持,同前
- 添加Hibernate支持,注意加上注解支持
- 建包,并反向生成实体类,注意使用注解,去掉实体类映射文件
- 添加struts支持
- 找到applicationContext.xml文件,找到beans标签,在命名空间内,添加context,如下:
xmlns:context=http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- 在applicationContext.xml文件内,添加context:
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="cn.jbit.dao.impl"></context:component-scan>
<context:component-scan base-package="cn.jbit.biz.impl"></context:component-scan>
<context:component-scan base-package="cn.jbit.action"></context:component-scan>
- 在需要托管的类名上方,添加@Service,来实现托管
时间: 2024-12-18 02:25:00