Class PropertyController

  • All Implemented Interfaces:
    Serializable

    @Named
    @ApplicationScoped
    public class PropertyController
    extends Object
    implements Serializable
    This PropertyController provides access to the Microprofile config api.

    The PropertyController can be used in a JSF page to access a specific property by name:

    #{propertyController.getProperty('my-property')} #{propertyController.getProperty('another-property','default value')}

    Author:
    rsoika
    See Also:
    Serialized Form
    • Constructor Detail

      • PropertyController

        public PropertyController()
    • Method Detail

      • getProperty

        public String getProperty​(String key)
        Returns a property value
        Parameters:
        key - - the property key
        Returns:
        property value
      • getProperty

        public String getProperty​(String key,
                                  String defaultValue)
        Returns a property value
        Parameters:
        key - - the property key
        defaultValue - - optional default value if property not defined
        Returns:
        property value