tjzero_sapce 2009-03-25 15:30
浏览 180
已采纳

SSH 集成的一些问题?

[code="java"][/code]SSH 集成的项目中, 在spring集成代理struts问题中, 似乎有两种方式,一种是在action 中修改type 为
[code="xml"]type="org.springframework.web.struts.DelegatingActionProxy" [/code]

在applicationContext.xml 中配置
[code="xml"]


[/code]

另外一种是不是不需要修改action 的type , 而在struts-config.xml中添加
[code="xml"]

[/code]
applicationContext.xml的配置不变呢?

另外还看到了一种写法
[code="xml"]
contextConfigLocation
/WEB-INF/application*.xml,classpath*:application*.xml


org.springframework.web.context.ContextLoaderListener
</listener[/code]

这种是监听器的 , 好像是把action 与spring 的配置信息 单独写在一个 xml 文件中的 ,是这样的么?
那种写法 好点 我比较喜欢第二种

[b]问题补充:[/b]
多问些问题 ,在web.xml中配置的话 怎么就灵活了 , 能举个例子么?

另外使用在web.xml 中配置的话 , 那 Struts 和 Spring 的集成信息又放在哪里呢?
是自己单独建立一个xml 文件写进去呢? 还是也和其它的配置信息统统卸载applicationContext.xml 中呢?

[b]问题补充:[/b]
哦 了解 主要还是为预防需要写多个Spring 配置文件的设想的.

  • 写回答

3条回答 默认 最新

  • zhoujuan520 2009-03-25 15:39
    关注

    不推荐使用 struts 的插件形式来集成spring

    还是通过 在web.xml里面配置通用一些,也灵活一些

    [code="xml"]

    contextConfigLocation

    /WEB-INF/application*.xml,classpath*:application*.xml





    org.springframework.web.context.ContextLoaderListener

    </listener [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?