用Spring创建action中的service属性
来源:互联网 发布:武威西安交大网络教育 编辑:程序博客网 时间:2024/05/21 00:48
比如 在 actionContext.xml里配置了Service和Action以及DAO
- <bean id="userService" class="com.service.UserService">
- <property name="userDao" ref="userDao"/>
- </bean>
- <bean id="userAction" class="com.action.UserAction">
- <property name="userService" ref="userService"/>
- <property name="userName" value="abcabc"/>
- </bean>
这样的话 action里的service就会自动通过set注入了。。。
然后struts里配置
- <action name="loginAction" class="userAction" method="login">
- <result name="success">welcome.jsp</result>
- </action>
这样的话就是用spring里的通过set注入了service和userName
如果是
- <action name="loginAction" class="com.action.UserAction" method="login">
- <result name="success">welcome.jsp</result>
- </action>
那么是不会通过spring的set装配的 可以用struts里的param标签注入参数
- 用Spring创建action中的service属性
- 创建action/service
- action,dao和service在spring中的配置
- 中的action属性
- spring注解@service("service")括号中的service有什么用
- spring注解@service("service")括号中的service有什么用
- spring注解@service("service")括号中的service有什么用
- spring注解@service("service")括号中的service有什么用
- spring注解@service("service")括号中的service有什么用
- form中的action属性问题
- action mapping中的attribute 属性
- <action>标签中的相关属性
- form表单中的action属性
- struts中的Action层调用服务层时,不需要在Spring配置文件中做属性注入
- Java Web中的Action、Dao、Service、Model
- ssh项目action中的service是null
- Java Web中的Action、Dao、Service、Model
- 【Spring In Action】注入Bean属性
- eclipse 自动同步tomcat webapps 文件
- [逗]如何处理不良资产
- 垃圾回收机制与引用类型
- 再读《The C Programming Language》 第二章 2.2 运算符
- 这样的情人节还是要彼此快乐
- 用Spring创建action中的service属性
- 如何成为一名卓有成效的管理者-德鲁克
- Java——代码块
- Vim进阶技术:搜索和替换
- 写正确程序需要注意的地方:一个数组是有一个递减数列座椅若干位形成的,在这种数组中查找某一个数。
- Java笔记整理(2)Java语言基础
- HDOJ 4268 Alice and Bob(贪心)
- hdu 1281
- Eclipse feature 理解