|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
<managed-bean>
declarations in
a faces-config.xml
configuration resource.
See:
Description
Enum Summary | |
---|---|
Scope | Enumeration describing the valid values for the scope
attribute of a Bean annotation. |
Annotation Types Summary | |
---|---|
Bean | Class-level annotation indicating that the decorated class should be treated as a JavaServer Faces "managed bean" definition for the bean name specified by the "name" attribute. |
Property | Field-level annotation indicating that the decorated field should be
initialized to a literal or value binding expression value specified by the
value attribute, when a managed instance of the containing
class is instantiated. |
Value | Deprecated. Use Property instead |
This package contains Java SE 5 annotations that support declaring
JavaServer Faces managed beans through annotations in the class source
code, rather than requiring <managed-bean>
declarations in
a faces-config.xml
configuration resource. The following annotation
types are supported:
It is possible for configuration entries to override the information
configured via annotations. Simply specify a <managed-bean>
with the same managed bean name, and override whatever settings you wish.
Note that, for this use case, it would be ideal if the bean class or property
type elements would not be required (since they can be inferred from the
source code of the annotated class). However, these elements are required
by the DTDs for JavaServer Faces 1.0 and 1.1 configuration resources.
A typical bean class using these annotations might look like this:
// Replaces configuration information in faces-config.xml @Bean(name="mybean" scope=Scope.SESSION) public class MyBeanClass { // Name a property that will be initialized via expression @Value("#{otherBean.otherProperty}") private String name = null; public String getName() { return this.name; } public void setName(String name) { this.name = name; } }
API STATUS: Experimental.
IMPLEMENTATION STATUS: Represented by the following classes:
Digester
instance that utilizes all of
the defined rule sets, returning a
FacesConfigConfig
instance representing all of the parsed configuration elements.VariableResolver
that implements the
standard managed bean functionality, plus support for annotated
managed beans.WARNING - The current implementation is incomplete
(compared to the functionality required by JSF), in that
<list-entries>
and <map-entries>
elements are not recognized, on either a managed bean or a managed
property. This restriction will be lifted later.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |