@spring Tag Reference

Tags for generating a bean-wiring file for the Spring framework.

@spring Class Level Tags

@spring.bean

@spring.property

@spring Field Level Tags

@spring Class Level Tag Usage

@spring.bean (0..1)

Defines a Spring bean.

ParameterTypeApplicabilityDescriptionMandatory
idtext ID for the bean. This should be unique within the spring configuration. Either this property, or the "name" property must be specified for each bean. false
nametext Name for the bean. This property can be used in place of the "id" attribute, where the name being used contains characters that would be invalid as an XML ID attribute. false
autowiretext Set's the autowiring mode for the bean. "byName" wires beans to properties by matching the bean's name to the property name. "byType" wires beans to properties by matching a bean's type to the property type. "constructor" wires beans through a constructor's parameters by matching types. "auto-detect" allows Spring to choose between "byType" and "constructor" as it sees fit. "no" indicates that no auto-wiring should be performed on this bean.
Valid options are:

no

byName

byType

constructor

auto-detect
false
dependency-checktext Sets dependency checking rules on a bean. "none" indicates no dependency checking. "simple" dependency checking includes primitives and String. "objects" dependency checking includes collaborators (other beans). "all" performs both "simple" and "objects" dependency checking.
Valid options are:

none

objects

simple

all
false
descriptiontext Describes the bean. false
destroy-methodtext The name of an method to be invoked on bean factory shutdown. false
init-methodtext The name of an initialization method to be invoked upon bean instantiation. false
lazy-initbool If "true", Spring will instantiate this bean when it's needed, rather than at bean factory startup. false
singletonbool If "true", one shared instance of this bean will be returned with every call to getBean(). If "false" each call results in a new instance.

Default value(s):

true
false

@spring.property (0..*)

Defines a property which may be defined in a superclass, but not in this particular bean class.

ParameterTypeApplicabilityDescriptionMandatory
reftext The id of another bean to wire to the property. false
listtext Comma-separated list of values to assign as a List to a property of type java.util.List. false
nametext The name of the property to be wired. true
valuetext The value to assign to the property. false

@spring Method Level Tag Usage

@spring.constructor-arg (0..*)

Wires a bean constructor argument.

ParameterTypeApplicabilityDescriptionMandatory
reftext The id of another bean to wire to the constructor argument. false
listtext Comma-separated list of values to assign as a List to a constructor argument of type java.util.List. false
valuetext The value to assign to the constructor argument. false

@spring.property (0..*)

Declares a bean property.

ParameterTypeApplicabilityDescriptionMandatory
reftext The id of another bean to wire to the property. false
listtext Comma-separated list of values to assign as a List to a property of type java.util.List. false
valuetext The value to assign to the property. false

@spring.validator (0..*)

Defines Commons Validator for current setter field.

ParameterTypeApplicabilityDescriptionMandatory
typetextValidator type, such as "required"true
msgkeytextOverride key for the validator error messagefalse
msgvaluetextExplicitly define a validator error messagefalse
pagetextOnly fields with a "page" attribute value that is equal to or less than the page property on the form JavaBean are processed.false
arg0valuetextValue of argument index 0false
arg0resourcetextResource key of argument index 0false
arg1valuetextValue of argument index 1false
arg1resourcetextResource key of argument index 1false
arg2valuetextValue of argument index 2false
arg2resourcetextResource key of argument index 2false
arg3valuetextValue of argument index 3false
arg3resourcetextResource key of argument index 3false

@spring.validator-args (0..1)

Defines arguments for current setter field.

ParameterTypeApplicabilityDescriptionMandatory
arg0valuetextValue of argument index 0false
arg0resourcetextResource key of argument index 0

Default value(s):

FormName.fieldName
false
arg1valuetextValue of argument index 1false
arg1resourcetextResource key of argument index 1false
arg2valuetextValue of argument index 2false
arg2resourcetextResource key of argument index 2false
arg3valuetextValue of argument index 3false
arg3resourcetextResource key of argument index 3false

@spring.validator-var (0..*)

Defines Commons Validator variable

ParameterTypeApplicabilityDescriptionMandatory
nametextVariable nametrue
valuetextVariable valuetrue

@spring Field Level Tag Usage