struts-default.xml配置文件中的bean配置
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
<bean type
="com.opensymphony.xwork2.ObjectFactory" name
="struts" class
="org.apache.struts2.impl.StrutsObjectFactory" />
bean通常有两个作用
- 创建bean实例,将该实例作为struts2框架的核心组件使用(该实例实现接口,接口是组件遵循的规范)
- bean包含的静态方法需要一个值注入
type : bean实现的接口
class : bean的实现类
本文详细介绍了Struts2框架中struts-default.xml配置文件内的bean配置方式及其作用。主要包括bean实例创建及核心组件使用,同时解释了bean中静态方法的值注入方式,以及type属性指定的接口和class属性指定的实现类。

被折叠的 条评论
为什么被折叠?



