简介 目录 评价 推荐
  • 努力学习的小猿 2019-07-19
    不使用Struts配置文件在Spring中Action配置需要改为多利即<bean>标签后添加scope属性"prototype"


    截图
    0赞 · 0采集
  • 大鹏111 2019-05-29

    Action类交给Spring创建(建议使用这种方式创建Action,因为可以使用Spring的AOP进行管理)(action创建的实例是多例模式,所以Action类bean标签要使用scope=“prototype”属性,其次action标签的class属性不再写类的全路径,而是Action<bean>标签的id)

    https://img4.mukewang.com/5cee69ed00018d1609530406.jpg

    0赞 · 0采集
  • weup 2018-04-16

    第二种整合方式

    https://img3.mukewang.com/5ad49d2f0001be1419200927.jpg

    0赞 · 0采集
  • 不知路 2018-03-18
    由Spring管理Action时,Struts配置文件中的内容
    截图
    0赞 · 1采集
  • 不知路 2018-03-18
    由Spring管理Action时,Spring配置文件中的内容,注意Action的配置为多例
    截图
    0赞 · 1采集
  • Saber00 2018-03-16
    spring配置action
    截图
    0赞 · 0采集
  • Saber00 2018-03-16
    struts和dao配置
    截图
    0赞 · 0采集
  • 246ba 2018-01-05
    applicationContext.xml
    截图
    0赞 · 0采集
  • 好佳的佳好 2017-10-31
    在struts中写action时只需要在class=“spring配置action的id名”
    截图
    0赞 · 0采集
  • 好佳的佳好 2017-10-31
    用spring创建action,配置bean时需要手动注入
    截图
    0赞 · 0采集
  • 小丸爱嗨皮 2017-09-03
    action类由Spring框架创建
    截图
    0赞 · 0采集
  • qq疯 2017-08-17
    配置action 的类 spring框架的方式
    截图
    0赞 · 0采集
  • qq_goforlonelin_0 2017-07-26
    struts2-spring-plugin的作用:在该jar包下面的struts-plugin.xml中可以看见这个配置<constant name="struts.objectFactory" value="spring" />,它的作用是什么呢?再来看struts2-core下面的default.properties中可以看到struts.objectFactory.spring.autoWire = name(通过前面在struts-plugin.xml中的配置开启了这个属性),它的意思是:在action类里面属性配置setter方法后,就自动将springBean里面的类注入了,不需要再初始化springBean然后getBean了,然而这也仅仅适用于action类由struts管理的情况,如果action类由spring管理,还是要在spring中注入action并配置相关service的依赖
    0赞 · 0采集
  • 慕沐6483227 2017-07-05
    Action在Strut.xml中的配置。
    截图
    0赞 · 0采集
  • 慕沐6483227 2017-07-05
    Struts2和Spring整合的第二种方式:Action的类交由Spring框架创建 建议使用这种方式,Action能够被Spring的AOP进行管理。
    截图
    0赞 · 0采集
  • 张月半 2017-05-19
    配置Action的类
    截图
    0赞 · 0采集
  • qq_浮生若水_1 2017-04-09
    Action的类交给Spring框架创建(推荐)
    0赞 · 0采集
  • qq_浮生若水_1 2017-04-09
    手动注入service
    0赞 · 0采集
  • qq_浮生若水_1 2017-04-09
    action类交给spring进行管理
    0赞 · 0采集
  • 夜还没黑 2017-03-11
    2、Action的类交给Spring框架创建(推荐) //applicationContext.xml <!-- 配置action类 --> <bean name="productAction" class="com.imooc.ssh.action.ProductAction" scope="prototype"> <!-- 手动注入service类 --> <property name="productService" ref="productService"></property> </bean> //struts.xml <package name="ssh" namespace="/" extends="struts-default"> <action name="product_*" method="{1}" class="productAction"> </action> </package>
    1赞 · 0采集
  • 尼古拉斯图卡蒙 2017-01-02
    scope=“prototype”是为每个请求提供一个action实例(与struts2的机制是一样的)。
    2赞 · 0采集
  • 尼古拉斯图卡蒙 2017-01-02
    Action调用service,service调用dao
    0赞 · 0采集
  • wwc 2016-11-12
    Strust交给Spring框架创建 struts.xml中action标签的class的值写为spring.xml中配置的对应bean标签的id 好处:可以使用AOP来对Action进行处理,增强某些操作
    1赞 · 0采集
  • 雾林湘竹 2016-10-25
    推荐使用spring管理action,如action可以用aop功能
    0赞 · 0采集
  • 这个名字都有人用 2016-10-01
    从action调用service,再从service调用DAO,这就是三大框架整合到一起的调用顺序 基于SSH实现员工管理系统之框架整合篇——Action类交给Spring创建 Action可以使用两种方式创建: 1.有Struts2自身创建:只需要在struts.xml中进行配置就可以 2.交给Spring进行创建: 先在applicationContext.xml中配置Action,这里id="productAction" <!-- 配置Action --> <bean id="productAction" class="cn.muke.ssh.action.ProductAction" scope="prototype"> <!-- 手动注入Service --> <property name="productService" ref="productService" /> </bean> <!-- 配置业务层 --> <bean id="productService" class="cn.muke.ssh.service.ProductService"> <property name="productDao" ref="productDao" /> </bean> <!-- 配置Dao层 --> <bean id="productDao" class="cn.muke.ssh.dao.ProductDao"> </bean> </beans> 然后在struts.xml中进行配置 <struts> <package name="ssh" extends="struts-default" namespace="/"> <action name="product_*" class="productAction" method="{1}"> </action> </package> </struts> 推荐使用Action的类交给Spring框架创建,因为这样可以使用AOP来管理,否则Struts2自身创建不支持AOP。
    3赞 · 3采集
  • 大咪 2016-09-09
    从action调用service,再从service调用DAO,这就是三大框架整合到一起的调用顺序
    0赞 · 0采集
  • CSA1 2016-09-08
    spring
    截图
    0赞 · 0采集
  • 梦编猿 2016-08-15
    基于SSH实现员工管理系统之框架整合篇——Action类交给Spring创建 Ps:推荐使用Action的类交给Spring框架创建,因为这样可以使用AOP来管理,否则Struts2自身创建不支持AOP。 【温馨提示:JavaSE/EE、SSH/SSM、Hybrid APP、JQ/JS/CSS3/H5等编程爱好者关注我,加我慕课好友,互相学习,共同进步!】
    截图
    1赞 · 2采集
数据加载中...
开始学习 免费