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:

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.

@since 1.0.1