All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.shale.tiger.managed.package.html Maven / Gradle / Ivy

The newest version!






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:

  • Bean - Declares this class to represent an instance of a managed bean, specifying the managed bean name and (optionally) the scope into which newly created instances should be placed.
  • Value - Declares that the annotated field is represented by a property setter, which will use the content of this element as either a literal String representing the value to be assigned (after appropriate conversion), or as a value binding expression to be evaluated in order to acquire the value to which this property should be set.

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy