分类:
2008-09-09 12:43:57
struts2 学习
一。 核心文件struts.xml 的配置
1。 bean的配置
主要就是名字的一个引用
...
The bean element has one required attribute, class, which specifies the class to be created or manipulated. A bean can either be created by the framework's container and injected into internal framework objects, or have values injected to its static methods The first use, object injection, is generally accompanied by the type attribute, which tells the container which interface this object implements. The second use, value injection, is good for allowing objects not created by the container to receive framework constants. Objects using value inject must define the the static attribute.Attribute Required Description class yes the name of the bean class type no the primary interface this class implements name no the unique name of this bean; must be unique among other beans that specify the same type scope no the scope of the bean; must be either default, singleton, request, session, thread static no whether to inject static methods or not; shouldn't be true when the type is specified optional no whether the bean is optional or not 3 Packages的配置简单就包的配置 是配置的一个逻辑规划Attribute Required Description name yes key to for other packages to reference extends no inherits package behavior of the package it extends namespace no see Namespace Configuration abstract no declares package to be abstract (no action configurations required in package) Sample usage Package Example (struts.xml)
{1}
execute
[1]