ITeye博客

Struts与Spring结合的3种实现方式

blessed24 · 2011-02-23 14:49 · SSH · 编程语言 · Spring · Struts · IOC · Bean · Markdown

1、  使用WebApplicationContext:这种方式是在Struts的Action类中获取Spring应用上WebApplicationContext的实例化对象,通过此对象调用Bean。

2、  继承Spring的ActionSupport:这种方式实际上是对第一种方式的一种简化,当Struts的Action类继承了Spring的ActionSupport以后,直接可以使用WebApplicationContext对旬,从而简化对Spring应用上下文的操作。

3、  将Struts的Action托管给Spring:这种方式将Struts的Action以Bean的形式托管给Spring,通过Spring Ioc容器管理各个Action。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。