使用@AutoWired替换struts2 Action中的get、set方法
来源:互联网 发布:免费海关数据 米课 编辑:程序博客网 时间:2024/05/17 14:14
public class LoginAction{
@Autowired
private ILoginDao loginDao;
@Autowired
private IReportDao reportDao;
......
}
spring applicationContext.xml
<!-- 注解扫描包 -->
<context:component-scan base-package="cn.XXX.ation" />
<bean id="loginDao" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="cn.XXX.dao.ILoginDao"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
<bean id="reportDao" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="cn.XXX.dao.IReportDao"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
<bean id="loginAction" class="cn.XXX.action.LoginAction"/>
关于dao的bean配置可以理解,但是action也需配置bean不理解
0 0
- 使用@AutoWired替换struts2 Action中的get、set方法
- struts action中的get set 方法
- Struts中的action传递参数到下个action,jsp时是使用get方法还是set方法
- Struts2中的get、set方法作用:Action与页面传值
- Struts2之------Action类中的get,set方法和execute方法的使用规范和使用流程(规范是没有理由的,必须遵守!!!)
- 开发日志:struts2开发注意Action方法不要使用get/set开头
- Struts2中的get、set方法重要性
- Struts2中的get、set方法重要性
- Struts2中的get、set方法作用:
- Struts2中的get、set方法作用
- Struts2中的get、set方法作用:
- Struts2中的get、set方法作用:
- struts2 action中set,get方法的作用
- 通过 @Autowired的使用来消除 set ,get方法 ---- Spring · JPA ·hibernate 的使用方法
- struts2 get 和set 方法
- struts2 Action中方法不要以get和set开头,否则会被struts调用
- javabean 注解替换set/get方法
- c#中的get/set方法
- ListView在ScrollView中显示不全或只显示一行的解决方法
- Centos7安装完毕后无法联网的解决方法
- 洛谷 P2982 [USACO10FEB]慢下来Slowing down
- iOS 10 推送必看(高阶1)
- hiho 1383 The Book List(windows文件系统)
- 使用@AutoWired替换struts2 Action中的get、set方法
- Android Studio2.0 教程从入门到精通MAC版 - 安装篇
- Android系统默认语言改为中文
- Android之socket编程
- java中的迭代器(Iterator)
- 【andorid】基于okhttp3网络请求帮助类(GET、POST)
- 微服务实战(一):微服务架构的优势与不足
- 时间处理工具类
- python2.7解决UTF-8 UnicodeEncodeError:'gbk' codec can't encode character u'\xa5' in position