---
title: "在struts的action中使用spring的IOC容器管理类"
author: "chenyubo"
date: "2008-07-28T21:06:46Z"
tags: ["IOC", "Spring", "Struts", "XML", "配置管理"]
slug: "struts-action-spring-ioc"
draft: false
lastmod: "2008-07-28T21:06:46Z"
id: 220768
url: "https://chenyubo.iteye.com/blog/220768"
---

struts-config.xml 配置文件如下 xml 代码 \[code="java"] \[/code] 其中最关键的地方是 action 的 type="org.springframework.web.struts.DelegatingActionProxy" 必须设置为spring的代理 spring的配置文件如下 xml 代码 \[code="java"] \[/code] 注意: action 对应的类必须 设置name属性,而不是id ,这里的name必须和struts配置文件中action的path相同