Class MyfacesConfig


  • public class MyfacesConfig
    extends Object
    Holds all configuration init parameters (from web.xml) that are independent from the core implementation. The parameters in this class are available to all shared, component and implementation classes. See RuntimeConfig for configuration infos that come from the faces-config files and are needed by the core implementation. MyfacesConfig is meant for components that implement some of the extended features of MyFaces. Anyhow, using the MyFaces Faces implementation is no precondition for using MyfacesConfig in custom components. Upon using another Faces implementation (or omitting the extended init parameters) all config properties will simply have their default values.
    • Field Detail

      • CONFIG_REFRESH_PERIOD

        @JSFWebConfigParam(defaultValue="2",
                           since="1.1",
                           classType="java.lang.Long")
        public static final String CONFIG_REFRESH_PERIOD
        Set the time in seconds that check for updates of web.xml and faces-config descriptors and refresh the configuration. This param is valid only if project stage is not production. Set this param to 0 disable this feature.
        See Also:
        Constant Field Values
      • RENDER_VIEWSTATE_ID

        @JSFWebConfigParam(defaultValue="true",
                           expectedValues="true, false, on, off, yes, no",
                           since="1.1",
                           ignoreUpperLowerCase=true,
                           group="state")
        public static final String RENDER_VIEWSTATE_ID
        Define if the input field that should store the state (jakarta.faces.ViewState) should render id="jakarta.faces.ViewState". Faces API 1.2 defines a "jakarta.faces.ViewState" client parameter, that must be rendered as both the "name" and the "id" attribute of the hidden input that is rendered for the purpose of state saving (see ResponseStateManager.VIEW_STATE_PARAM). Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on one page. With the org.apache.myfaces.RENDER_VIEWSTATE_ID context parameter you can tune this behaviour.
        Set it to
        • true - to render Faces 1.2 compliant id attributes (that might cause invalid XHTML), or
        • false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript components)
        Default value is: true (for backwards compatibility and Faces 1.2 compliancy)
        See Also:
        Constant Field Values
      • STRICT_XHTML_LINKS

        @JSFWebConfigParam(defaultValue="true",
                           expectedValues="true, false, on, off, yes, no",
                           since="1.1.6",
                           ignoreUpperLowerCase=true,
                           group="render")
        public static final String STRICT_XHTML_LINKS
        Use "&" entity instead a plain "&" character within HTML.

        W3C recommends to use the "&amp;" entity instead of a plain "&" character within HTML. This also applies to attribute values and thus to the "href" attribute of <a> elements as well. Even more, when XHTML is used as output the usage of plain "&" characters is forbidden and would lead to invalid XML code. Therefore, since version 1.1.6 MyFaces renders the correct "&amp;" entity for links.

        The init parameter org.apache.myfaces.STRICT_XHTML_LINKS makes it possible to restore the old behaviour and to make MyFaces "bug compatible" to the Sun RI which renders plain "&" chars in links as well.

        See: HTML 4.01 Specification See: Jira: MYFACES-1774

        See Also:
        Constant Field Values
      • RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON

        @JSFWebConfigParam(defaultValue="false",
                           expectedValues="true, false, on, off, yes, no",
                           since="1.2.3",
                           ignoreUpperLowerCase=true,
                           group="render")
        public static final String RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON
        This param renders the clear javascript on button necessary only for compatibility with hidden fields feature of myfaces. This is done because jsf ri does not render javascript on onclick method for button, so myfaces should do this.
        See Also:
        Constant Field Values
      • DELEGATE_FACES_SERVLET

        @JSFWebConfigParam(since="1.2.7")
        public static final String DELEGATE_FACES_SERVLET
        Define an alternate class name that will be used to initialize MyFaces, instead the default jakarta.faces.webapp.FacesServlet.

        This helps MyFaces to detect the mappings and other additional configuration used to setup the environment, and prevent abort initialization if no FacesServlet config is detected.

        See Also:
        Constant Field Values
      • REFRESH_TRANSIENT_BUILD_ON_PSS

        @JSFWebConfigParam(since="2.0",
                           defaultValue="auto",
                           expectedValues="true,false,auto",
                           tags="performance",
                           ignoreUpperLowerCase=true,
                           group="state")
        public static final String REFRESH_TRANSIENT_BUILD_ON_PSS
        Indicate if the facelet associated to the view should be reapplied when the view is refreshed. Default mode is "auto".

        This param is only valid when partial state saving is on. If this is set as true, the tag-handlers are always reapplied before render view, like in facelets 1.1.x, allowing c:if work correctly to "toggle" components based on a value changed on invoke application phase. If the param is set as "auto", the implementation check if c:if, c:forEach, c:choose and ui:include with src=ELExpression is used on the page and if that so, mark the view to be refreshed.

        See Also:
        Constant Field Values
      • REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE

        @JSFWebConfigParam(since="2.0",
                           defaultValue="false",
                           expectedValues="true, false, on, off, yes, no",
                           tags="performance",
                           ignoreUpperLowerCase=true,
                           group="state")
        public static final String REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE
        Enable or disable a special mode that enable full state for parent components containing c:if, c:forEach, c:choose and ui:include with src=ELExpression. By default is disabled(false).

        This param is only valid when partial state saving is on. If this is set as true, parent components containing c:if, c:forEach, c:choose and ui:include with src=ELExpression are marked to be restored fully, so state is preserved between request.

        See Also:
        Constant Field Values
      • VALIDATE_XML

        @JSFWebConfigParam(since="2.0",
                           expectedValues="true, false, on, off, yes, no",
                           ignoreUpperLowerCase=true)
        public static final String VALIDATE_XML
        If set to true, tag library XML files and faces config XML files using schema will be validated during application start up
        See Also:
        Constant Field Values
      • WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG

        @JSFWebConfigParam(since="2.0.1",
                           expectedValues="true, false, on, off, yes, no",
                           defaultValue="false",
                           ignoreUpperLowerCase=true,
                           group="render")
        public static final String WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG
        Wrap content inside script with xml comment to prevent old browsers to display it. By default it is true.
        See Also:
        Constant Field Values
      • DEBUG_PHASE_LISTENER

        @JSFWebConfigParam(since="2.0.8")
        public static final String DEBUG_PHASE_LISTENER
        Enable/disable DebugPhaseListener feature, with provide useful information about ValueHolder variables (submittedValue, localValue, value). Note evaluate those getters for each component could cause some unwanted side effects when using "access" type scopes like on MyFaces CODI. This param only has effect when project stage is Development.
        See Also:
        Constant Field Values
      • STRICT_JSF_2_CC_EL_RESOLVER

        @JSFWebConfigParam(since="2.0.10",
                           expectedValues="true, false",
                           defaultValue="false",
                           group="EL")
        public static final String STRICT_JSF_2_CC_EL_RESOLVER
        Change default getType() behavior for composite component EL resolver, from return null (see Faces 2_0 spec section 5_6_2_2) to use the metadata information added by composite:attribute, ensuring components working with chained EL expressions to find the right type when a getType() is called over the source EL expression. To ensure strict compatibility with the spec set this param to true (by default is false, so the change is enabled by default).
        See Also:
        Constant Field Values
      • DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE

        @JSFWebConfigParam(since="2.0.11,2.1.5",
                           expectedValues="text/html, application/xhtml+xml",
                           defaultValue="text/html",
                           group="render")
        public static final String DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE
        Define the default content type that the default ResponseWriter generates, when no match can be derived from HTTP Accept Header.
        See Also:
        Constant Field Values
      • VIEW_UNIQUE_IDS_CACHE_ENABLED

        @JSFWebConfigParam(defaultValue="true",
                           since="2.0.13, 2.1.7",
                           expectedValues="true, false",
                           group="viewhandler",
                           tags="performance",
                           desc="Enable or disable a cache used to \'remember\' the generated facelets unique ids and reduce the impact over memory usage.")
        public static final String VIEW_UNIQUE_IDS_CACHE_ENABLED
        Enable or disable a cache used to "remember" the generated facelets unique ids and reduce the impact on memory usage, only active if jakarta.faces.FACELETS_REFRESH_PERIOD is -1 (no refresh).
        See Also:
        Constant Field Values
      • COMPONENT_UNIQUE_IDS_CACHE_SIZE

        @JSFWebConfigParam(defaultValue="100",
                           since="2.0.13, 2.1.7",
                           group="viewhandler",
                           tags="performance")
        public static final String COMPONENT_UNIQUE_IDS_CACHE_SIZE
        Set the size of the cache used to store strings generated using SectionUniqueIdCounter for component ids. If this is set to 0, no cache is used. By default is set to 200.
        See Also:
        Constant Field Values
      • STRICT_JSF_2_VIEW_NOT_FOUND

        @JSFWebConfigParam(since="2.1.13",
                           defaultValue="false",
                           expectedValues="true,false",
                           group="viewhandler")
        public static final String STRICT_JSF_2_VIEW_NOT_FOUND
        If this param is set to true, a check will be done in Restore View Phase to check if the viewId exists or not and if it does not exists, a 404 response will be thrown. This is applicable in cases where all the views in the application are generated by a ViewDeclarationLanguage implementation.
        See Also:
        Constant Field Values
      • EARLY_FLUSH_ENABLED

        @JSFWebConfigParam(defaultValue="false",
                           since="2.2.0",
                           expectedValues="true, false",
                           group="render",
                           tags="performance",
                           desc="Enable or disable an early flush which allows to send e.g. the HTML-Head to the client while the rest gets rendered. It\'s a well known technique to reduce the time for loading a page.")
        public static final String EARLY_FLUSH_ENABLED
        See Also:
        Constant Field Values
      • STRICT_JSF_2_FACELETS_COMPATIBILITY

        @JSFWebConfigParam(since="2.2.0",
                           defaultValue="false",
                           expectedValues="true,false",
                           group="viewhandler")
        public static final String STRICT_JSF_2_FACELETS_COMPATIBILITY
        This param makes components like c:set, ui:param and templating components like ui:decorate, ui:composition and ui:include to behave like the ones provided originally in facelets 1_1_x. See MYFACES-3810 for details.
        See Also:
        Constant Field Values
      • RENDER_FORM_VIEW_STATE_AT_BEGIN

        @JSFWebConfigParam(since="2.2.4",
                           defaultValue="false",
                           expectedValues="true,false",
                           group="render")
        public static final String RENDER_FORM_VIEW_STATE_AT_BEGIN
        This param makes h:form component to render the view state and other hidden fields at the beginning of the form. This also includes component resources with target="form", but it does not include legacy 1.1 myfaces specific hidden field adition.
        See Also:
        Constant Field Values
      • FLASH_SCOPE_DISABLED

        @JSFWebConfigParam(defaultValue="false",
                           since="2.0.5")
        public static final String FLASH_SCOPE_DISABLED
        Defines whether flash scope is disabled, preventing add the Flash cookie to the response.

        This is useful for applications that does not require to use flash scope, and instead uses other scopes.

        See Also:
        Constant Field Values
      • NUMBER_OF_VIEWS_IN_SESSION

        @JSFWebConfigParam(defaultValue="20",
                           since="1.1",
                           classType="java.lang.Integer",
                           group="state",
                           tags="performance")
        public static final String NUMBER_OF_VIEWS_IN_SESSION
        Defines the amount (default = 20) of the latest views are stored in session.

        Only applicable if state saving method is "server" (= default).

        See Also:
        Constant Field Values
      • NUMBER_OF_VIEWS_IN_SESSION_DEFAULT

        public static final int NUMBER_OF_VIEWS_IN_SESSION_DEFAULT
        Default value for org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION context parameter.
        See Also:
        Constant Field Values
      • NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION

        @JSFWebConfigParam(since="2.0.6",
                           classType="java.lang.Integer",
                           group="state",
                           tags="performance",
                           defaultValue="4")
        public static final String NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
        Indicates the amount of views (default is not active) that should be stored in session between sequential POST or POST-REDIRECT-GET if org.apache.myfaces.USE_FLASH_SCOPE_PURGE_VIEWS_IN_SESSION is true.

        Only applicable if state saving method is "server" (= default). For example, if this param has value = 2 and in your custom webapp there is a form that is clicked 3 times, only 2 views will be stored and the third one (the one stored the first time) will be removed from session, even if the view can store more sessions org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION. This feature becomes useful for multi-window applications. where without this feature a window can swallow all view slots so the other ones will throw ViewExpiredException.

        See Also:
        Constant Field Values
      • NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT

        public static final Integer NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT
      • NUMBER_OF_FLASH_TOKENS_IN_SESSION

        @JSFWebConfigParam(since="2.2.6",
                           group="state",
                           tags="performance")
        public static final String NUMBER_OF_FLASH_TOKENS_IN_SESSION
        Indicate the max number of flash tokens stored into session. It is only active when jakarta.faces.CLIENT_WINDOW_MODE is enabled and jakarta.faces.STATE_SAVING_METHOD is set to "server". Each flash token is associated to one client window id at the same time, so this param is related to the limit of active client windows per session. By default is the same number as in (org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION / org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION) + 1 = 6.
        See Also:
        Constant Field Values
      • SUPPORT_EL_3_IMPORT_HANDLER

        @JSFWebConfigParam(since="2.2.9",
                           defaultValue="false",
                           expectedValues="true,false",
                           group="EL")
        public static final String SUPPORT_EL_3_IMPORT_HANDLER
        This parameter specifies whether or not the ImportHandler will be supported
        See Also:
        Constant Field Values
      • STRICT_JSF_2_ORIGIN_HEADER_APP_PATH

        @JSFWebConfigParam(since="2.3",
                           defaultValue="false",
                           expectedValues="true,false")
        public static final String STRICT_JSF_2_ORIGIN_HEADER_APP_PATH
        This parameter specifies whether or not the Origin header app path should be checked
        See Also:
        Constant Field Values
      • STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME

        @JSFWebConfigParam(since="2.1.6, 2.0.12",
                           defaultValue="false",
                           expectedValues="true, false",
                           group="resources")
        public static final String STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME
        Allow slash in the library name of a Resource.
        See Also:
        Constant Field Values
      • RESOURCE_BUFFER_SIZE

        @JSFWebConfigParam(since="2.1.10, 2.0.16",
                           defaultValue="2048",
                           group="resources")
        public static final String RESOURCE_BUFFER_SIZE
        Define the default buffer size that is used between Resource.getInputStream() and httpServletResponse.getOutputStream() when rendering resources using the default ResourceHandler.
        See Also:
        Constant Field Values
      • VALIDATE

        @JSFWebConfigParam(since="2.0",
                           defaultValue="false",
                           expectedValues="true, false")
        public static final String VALIDATE
        Validate if the managed beans and navigations rules are correct.

        For example, it checks if the managed bean classes really exists, or if the navigation rules points to existing view files.

        See Also:
        Constant Field Values
      • USE_CDI_FOR_ANNOTATION_SCANNING

        @JSFWebConfigParam(since="2.2.9",
                           tags="performance",
                           defaultValue="false")
        public static final String USE_CDI_FOR_ANNOTATION_SCANNING
        Defines if CDI should be used for annotation scanning to improve the startup performance.
        See Also:
        Constant Field Values
      • RESOURCE_HANDLER_CACHE_SIZE

        @JSFWebConfigParam(defaultValue="500",
                           since="2.0.2",
                           group="resources",
                           classType="java.lang.Integer",
                           tags="performance")
        public static final String RESOURCE_HANDLER_CACHE_SIZE
        Controls the size of the cache used to check if a resource exists or not.

        See org.apache.myfaces.RESOURCE_HANDLER_CACHE_ENABLED for details.

        See Also:
        Constant Field Values
      • RESOURCE_HANDLER_CACHE_ENABLED

        @JSFWebConfigParam(defaultValue="true",
                           since="2.0.2",
                           group="resources",
                           expectedValues="true,false",
                           tags="performance")
        public static final String RESOURCE_HANDLER_CACHE_ENABLED
        Enable or disable the cache used to "remember" if a resource handled by the default ResourceHandler exists or not.
        See Also:
        Constant Field Values
      • SCAN_PACKAGES

        @JSFWebConfigParam(since="2.0")
        public static final String SCAN_PACKAGES
        Servlet context init parameter which defines which packages to scan for beans, separated by commas.
        See Also:
        Constant Field Values
      • WEBSOCKET_ENDPOINT_PORT

        @JSFWebConfigParam(since="2.3")
        public static final String WEBSOCKET_ENDPOINT_PORT
        Indicates the port used for websocket connections.
        See Also:
        Constant Field Values
      • WEBSOCKET_MAX_IDLE_TIMEOUT

        @JSFWebConfigParam(defaultValue="300000")
        public static final String WEBSOCKET_MAX_IDLE_TIMEOUT
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN

        @JSFWebConfigParam(since="2.2.0",
                           expectedValues="secureRandom, random",
                           defaultValue="secureRandom",
                           group="state")
        public static final String RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN
        Defines how to generate the csrf session token.
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN_SECURE_RANDOM

        public static final String RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN_SECURE_RANDOM
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN_RANDOM

        public static final String RANDOM_KEY_IN_WEBSOCKET_SESSION_TOKEN_RANDOM
        See Also:
        Constant Field Values
      • CLIENT_VIEW_STATE_TIMEOUT

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           defaultValue="0",
                           group="state")
        public static final String CLIENT_VIEW_STATE_TIMEOUT
        Define the time in minutes where the view state is valid when client side state saving is used. By default it is set to 0 (infinite).
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           expectedValues="secureRandom, random",
                           defaultValue="secureRandom",
                           group="state")
        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN
        Adds a random key to the generated view state session token.
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM

        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_RANDOM

        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_RANDOM
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_LENGTH

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           defaultValue="8",
                           group="state")
        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_LENGTH
        Set the default length of the random key added to the view state session token. By default is 8.
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_CLASS

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           group="state")
        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_CLASS
        Sets the random class to initialize the secure random id generator. By default it uses java.security.SecureRandom
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_PROVIDER

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           group="state")
        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_PROVIDER
        Sets the random provider to initialize the secure random id generator.
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_ALGORITHM

        @JSFWebConfigParam(since="2.1.9, 2.0.15",
                           defaultValue="SHA1PRNG",
                           group="state")
        public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_ALGORITHM
        Sets the random algorithm to initialize the secure random id generator. By default is SHA1PRNG
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM

        public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM

        public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM
        See Also:
        Constant Field Values
      • RANDOM_KEY_IN_CSRF_SESSION_TOKEN

        @JSFWebConfigParam(since="2.2.0",
                           expectedValues="secureRandom, random",
                           defaultValue="secureRandom",
                           group="state")
        public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN
        Defines how to generate the csrf session token.
        See Also:
        Constant Field Values
      • COMPRESS_STATE_IN_SESSION

        @JSFWebConfigParam(defaultValue="true",
                           since="1.1",
                           expectedValues="true,false",
                           group="state",
                           tags="performance")
        public static final String COMPRESS_STATE_IN_SESSION
        Indicates that the serialized state will be compressed before it is written to the session. By default true. Only applicable if state saving method is "server" (= default) and if org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default). If true (default) the serialized state will be compressed before it is written to the session. If false the state will not be compressed.
        See Also:
        Constant Field Values
      • USE_FLASH_SCOPE_PURGE_VIEWS_IN_SESSION

        @JSFWebConfigParam(since="2.0.6",
                           defaultValue="false",
                           expectedValues="true, false",
                           group="state")
        public static final String USE_FLASH_SCOPE_PURGE_VIEWS_IN_SESSION
        Allow use flash scope to keep track of the views used in session and the previous ones, so server side state saving can delete old views even if POST-REDIRECT-GET pattern is used.

        Only applicable if state saving method is "server" (= default). The default value is false.

        See Also:
        Constant Field Values
      • AUTOCOMPLETE_OFF_VIEW_STATE

        @JSFWebConfigParam(since="2.2.8, 2.1.18, 2.0.24",
                           expectedValues="true, false",
                           defaultValue="true",
                           group="state")
        public static final String AUTOCOMPLETE_OFF_VIEW_STATE
        Add autocomplete="off" to the view state hidden field. Enabled by default.
        See Also:
        Constant Field Values
      • RESOURCE_MAX_TIME_EXPIRES

        @JSFWebConfigParam(since="2.0",
                           defaultValue="604800000",
                           group="resources",
                           tags="performance")
        public static final String RESOURCE_MAX_TIME_EXPIRES
        Set the max time in miliseconds set on the "Expires" header for a resource rendered by the default ResourceHandler. (default to one week in miliseconds or 604800000)
        See Also:
        Constant Field Values
      • LAZY_LOAD_CONFIG_OBJECTS

        @JSFWebConfigParam(defaultValue="true",
                           since="2.0",
                           tags="performance")
        public static final String LAZY_LOAD_CONFIG_OBJECTS
        Indicate if the classes associated to components, converters, validators or behaviors should be loaded as soon as they are added to the current application instance or instead loaded in a lazy way.
        See Also:
        Constant Field Values
      • EL_RESOLVER_COMPARATOR

        @JSFWebConfigParam(since="1.2.10, 2.0.2",
                           group="EL",
                           desc="The Class of an Comparator&lt;ELResolver&gt; implementation.")
        public static final String EL_RESOLVER_COMPARATOR
        Define a custom comparator class used to sort the ELResolvers.

        This is useful when it is necessary to put an ELResolver on top of other resolvers. Note set this param override the default ordering described by Faces spec section 5.

        See Also:
        Constant Field Values
      • EL_RESOLVER_PREDICATE

        @JSFWebConfigParam(since="2.1.0",
                           group="EL",
                           desc="The Class of an java.util.function.Predicate&lt;ELResolver&gt; implementation.If used and returns false for a ELResolver instance, such resolver will not be installed in ELResolvers chain. Use with caution - can break functionality defined in Faces specification \'ELResolver Instances Provided by Faces\'")
        public static final String EL_RESOLVER_PREDICATE
        See Also:
        Constant Field Values
      • VIEWID_CACHE_SIZE

        @JSFWebConfigParam(defaultValue="500",
                           since="2.0.2",
                           group="viewhandler",
                           tags="performance",
                           classType="java.lang.Integer",
                           desc="Controls the size of the viewId related caches: VIEWID_EXISTS_CACHE_ENABLED, VIEWID_PROTECTED_CACHE_ENABLED, VIEWID_DERIVE_CACHE_ENABLED")
        public static final String VIEWID_CACHE_SIZE
        See Also:
        Constant Field Values
      • VIEWID_EXISTS_CACHE_ENABLED

        @JSFWebConfigParam(defaultValue="true",
                           since="2.0.2",
                           expectedValues="true, false",
                           group="viewhandler",
                           tags="performance",
                           desc="Enable or disable the cache used to \'remember\' if a view exists or not and reduce the impact of sucesive calls to ExternalContext.getResource().")
        public static final String VIEWID_EXISTS_CACHE_ENABLED
        See Also:
        Constant Field Values
      • VIEWID_PROTECTED_CACHE_ENABLED

        @JSFWebConfigParam(defaultValue="true",
                           since="2.3-next",
                           expectedValues="true, false",
                           group="viewhandler",
                           tags="performance",
                           desc="Enable or disable the cache used to \'remember\' if a view is protected or not.")
        public static final String VIEWID_PROTECTED_CACHE_ENABLED
        See Also:
        Constant Field Values
      • VIEWID_DERIVE_CACHE_ENABLED

        @JSFWebConfigParam(defaultValue="true",
                           since="2.3-next",
                           expectedValues="true, false",
                           group="viewhandler",
                           tags="performance",
                           desc="Enable or disable the cache used to \'remember\' the derived viewId from the rawViewId.")
        public static final String VIEWID_DERIVE_CACHE_ENABLED
        See Also:
        Constant Field Values
      • BEAN_BEFORE_JSF_VALIDATION

        @JSFWebConfigParam(defaultValue="false",
                           expectedValues="true, false",
                           since="2.2.10",
                           group="validation")
        public static final String BEAN_BEFORE_JSF_VALIDATION
        Enforce f:validateBean to be called first before any Faces validator.
        See Also:
        Constant Field Values
      • FACES_INIT_PLUGINS

        @JSFWebConfigParam(since="2.0")
        public static final String FACES_INIT_PLUGINS
        comma delimited list of plugin classes which can be hooked into myfaces
        See Also:
        Constant Field Values
      • INITIALIZE_SKIP_JAR_FACES_CONFIG_SCAN

        @JSFWebConfigParam(since="2.2.10",
                           expectedValues="true, false",
                           defaultValue="false",
                           tags="performance")
        public static final String INITIALIZE_SKIP_JAR_FACES_CONFIG_SCAN
        If the flag is true, the algoritm skip jar scanning for faces-config files to check if the current application requires FacesServlet to be added dynamically (servlet spec 3). This param can be set using a system property with the same name too.
        See Also:
        Constant Field Values
      • INITIALIZE_ALWAYS_STANDALONE

        @JSFWebConfigParam(since="2.0.3",
                           defaultValue="false")
        public static final String INITIALIZE_ALWAYS_STANDALONE
        If this param is set to true, the check for faces servlet mapping is not done
        See Also:
        Constant Field Values
      • EXPRESSION_FACTORY

        @JSFWebConfigParam(since="1.2.7",
                           group="EL")
        public static final String EXPRESSION_FACTORY
        This parameter specifies the ExpressionFactory implementation to use.
        See Also:
        Constant Field Values
      • CHECK_ID_PRODUCTION_MODE

        @JSFWebConfigParam(since="2.0.12, 2.1.6",
                           defaultValue="auto",
                           expectedValues="true, auto, false",
                           group="state",
                           tags="performance")
        public static final String CHECK_ID_PRODUCTION_MODE
        Define how duplicate ids are checked when ProjectStage is Production, by default (auto) it only check ids of components that does not encapsulate markup (like facelets UILeaf).
        • true: check all ids, including ids for components that are transient and encapsulate markup.
        • auto: (default) check ids of components that does not encapsulate markup (like facelets UILeaf). Note ids of UILeaf instances are generated by facelets vdl, start with "j_id", are never rendered into the response and UILeaf instances are never used as a target for listeners, so in practice there is no need to check such ids. This reduce the overhead associated with generate client ids.
        • false: do not do any check when ProjectStage is Production

        According to specification, identifiers must be unique within the scope of the nearest ancestor to the component that is a naming container.

        See Also:
        Constant Field Values
      • MARK_INITIAL_STATE_WHEN_APPLY_BUILD_VIEW

        @JSFWebConfigParam(since="2.1",
                           defaultValue="false",
                           expectedValues="true, false",
                           tags="performance")
        public static final String MARK_INITIAL_STATE_WHEN_APPLY_BUILD_VIEW
        See Also:
        Constant Field Values
      • CACHE_EL_EXPRESSIONS

        @JSFWebConfigParam(since="2.0.8",
                           defaultValue="noCache",
                           expectedValues="noCache, strict, allowCset, always, alwaysRecompile",
                           group="EL",
                           tags="performance")
        public static final String CACHE_EL_EXPRESSIONS
        Indicates if expressions generated by facelets should be cached or not. Default is noCache. There there are four modes:
        • alwaysRecompile (since 2.1.12): Only does not cache when the expression contains a variable resolved using VariableMapper
        • always: Only does not cache when expressions are inside user tags or the expression contains a variable resolved using VariableMapper
        • allowCset: Like always, but does not allow cache when ui:param was used on the current template context
        • strict: Like allowCset, but does not allow cache when c:set with var and value properties only is used on the current page context
        • noCache: All expression are created each time the view is built
        See Also:
        Constant Field Values
      • WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE

        @JSFWebConfigParam(since="2.0.9, 2.1.3",
                           defaultValue="true",
                           expectedValues="true, false")
        public static final String WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE
        Wrap exception caused by calls to EL expressions, so information like the location, expression string and tag name can be retrieved by the ExceptionHandler implementation and used to output meaningful information about itself.

        Note in some cases this will wrap the original jakarta.el.ELException, so the information will not be on the stack trace unless ExceptionHandler retrieve checking if the exception implements ContextAware interface and calling getWrapped() method.

        See Also:
        Constant Field Values
      • RESOURCE_CACHE_LAST_MODIFIED

        @JSFWebConfigParam(since="2.3-next",
                           defaultValue="true",
                           expectedValues="true, false")
        public static final String RESOURCE_CACHE_LAST_MODIFIED
        Defines if the last-modified should be cached of the resources when the ProjectStage is Production. If the cache is disabled, each last-modified request will read the last-modified from the file.
        See Also:
        Constant Field Values
      • LOG_WEB_CONTEXT_PARAMS

        @JSFWebConfigParam(expectedValues="true, auto, false",
                           defaultValue="auto")
        public static final String LOG_WEB_CONTEXT_PARAMS
        Indicate if log all web config params should be done before initialize the webapp.

        If is set in "auto" mode, web config params are only logged on "Development" and "Production" project stages.

        See Also:
        Constant Field Values
      • AUTOMATIC_EXTENSIONLESS_MAPPING_DEFAULT

        public static final boolean AUTOMATIC_EXTENSIONLESS_MAPPING_DEFAULT
        See Also:
        Constant Field Values
      • FACES_INITIALIZER

        @JSFWebConfigParam(since="2.0.1",
                           desc="Class name of a custom FacesInitializer implementation.")
        public static final String FACES_INITIALIZER
        Indicate the class implementing FacesInitializer interface that will be used to setup MyFaces Core contexts.

        This is used when some custom task must be done specifically when a myfaces web context is initialized or destroyed, or when MyFaces should be initialized in some custom environment.

        See Also:
        Constant Field Values
      • INJECTION_PROVIDER

        @JSFWebConfigParam(name="org.apache.myfaces.spi.InjectionProvider",
                           since="2.2")
        public static final String INJECTION_PROVIDER
        Define the class implementing InjectionProvider interface to handle dependendy injection, PostConstruct and PreDestroy callbacks.

        This also can be configured using a SPI entry (/META-INF/services/...).

      • WEBSOCKET_MAX_CONNECTIONS

        @JSFWebConfigParam(name="org.apache.myfaces.WEBSOCKET_MAX_CONNECTIONS",
                           since="2.3")
        public static final String WEBSOCKET_MAX_CONNECTIONS
        See Also:
        Constant Field Values
      • WEBSOCKET_MAX_CONNECTIONS_DEFAULT

        public static final Integer WEBSOCKET_MAX_CONNECTIONS_DEFAULT
      • RENDER_CLIENTBEHAVIOR_SCRIPTS_AS_STRING

        @JSFWebConfigParam(name="org.apache.myfaces.RENDER_CLIENTBEHAVIOR_SCRIPTS_AS_STRING",
                           since="2.3-next",
                           defaultValue="false")
        public static final String RENDER_CLIENTBEHAVIOR_SCRIPTS_AS_STRING
        Defines if the clientbehavior scripts are passed as string or function to the faces.util.chain. "As string" is actually the default behavior of both MyFaces (until 2.3-next) and Mojarra. "As function" is quite usefull for CSP as no string needs to be evaluated as function. Our faces.util.chain supports both of course.
        See Also:
        Constant Field Values
      • RENDER_CLIENTBEHAVIOR_SCRIPTS_AS_STRING_DEFAULT

        public static final boolean RENDER_CLIENTBEHAVIOR_SCRIPTS_AS_STRING_DEFAULT
        See Also:
        Constant Field Values
      • ALWAYS_FORCE_SESSION_CREATION

        @JSFWebConfigParam(since="2.3.6",
                           defaultValue="false",
                           expectedValues="true,false")
        public static final String ALWAYS_FORCE_SESSION_CREATION
        Defines if a session should be created (if one does not exist) before response rendering. When this parameter is set to true, a session will be created even when client side state saving or stateless views are used, which can lead to unintended resource consumption. When this parameter is set to false, a session will only be created before response rendering if a view is not transient and server side state saving is in use.
        See Also:
        Constant Field Values
      • ALWAYS_FORCE_SESSION_CREATION_DEFAULT

        protected static final boolean ALWAYS_FORCE_SESSION_CREATION_DEFAULT
        See Also:
        Constant Field Values
      • EL_RESOLVER_TRACING

        @JSFWebConfigParam(name="org.apache.myfaces.EL_RESOLVER_TRACING",
                           since="4.0",
                           defaultValue="false")
        public static final String EL_RESOLVER_TRACING
        Defines if ELResolvers should be traced on each request and logged. Only active on Development ProjectStage.
        See Also:
        Constant Field Values
      • EL_RESOLVER_TRACING_DEFAULT

        public static final boolean EL_RESOLVER_TRACING_DEFAULT
        See Also:
        Constant Field Values
    • Constructor Detail

      • MyfacesConfig

        public MyfacesConfig()
    • Method Detail

      • getCurrentInstance

        public static MyfacesConfig getCurrentInstance()
      • isMyfacesImplAvailable

        public boolean isMyfacesImplAvailable()
      • isRiImplAvailable

        public boolean isRiImplAvailable()
      • isStrictJsf2AllowSlashLibraryName

        public boolean isStrictJsf2AllowSlashLibraryName()
      • getConfigRefreshPeriod

        public long getConfigRefreshPeriod()
      • isRenderViewStateId

        public boolean isRenderViewStateId()
      • isStrictXhtmlLinks

        public boolean isStrictXhtmlLinks()
      • isRenderClearJavascriptOnButton

        public boolean isRenderClearJavascriptOnButton()
      • getDelegateFacesServlet

        public String getDelegateFacesServlet()
      • isRefreshTransientBuildOnPSS

        public boolean isRefreshTransientBuildOnPSS()
      • isRefreshTransientBuildOnPSSAuto

        public boolean isRefreshTransientBuildOnPSSAuto()
      • isRefreshTransientBuildOnPSSPreserveState

        public boolean isRefreshTransientBuildOnPSSPreserveState()
      • isValidateXML

        public boolean isValidateXML()
      • isWrapScriptContentWithXmlCommentTag

        public boolean isWrapScriptContentWithXmlCommentTag()
      • isDebugPhaseListenerEnabled

        public boolean isDebugPhaseListenerEnabled()
      • isStrictJsf2CCELResolver

        public boolean isStrictJsf2CCELResolver()
      • getDefaultResponseWriterContentTypeMode

        public String getDefaultResponseWriterContentTypeMode()
      • isViewUniqueIdsCacheEnabled

        public boolean isViewUniqueIdsCacheEnabled()
      • getComponentUniqueIdsCacheSize

        public int getComponentUniqueIdsCacheSize()
      • isStrictJsf2ViewNotFound

        public boolean isStrictJsf2ViewNotFound()
      • isEarlyFlushEnabled

        public boolean isEarlyFlushEnabled()
      • isStrictJsf2FaceletsCompatibility

        public boolean isStrictJsf2FaceletsCompatibility()
      • isRenderFormViewStateAtBegin

        public boolean isRenderFormViewStateAtBegin()
      • isFlashScopeDisabled

        public boolean isFlashScopeDisabled()
      • getNumberOfViewsInSession

        public Integer getNumberOfViewsInSession()
      • getNumberOfSequentialViewsInSession

        public Integer getNumberOfSequentialViewsInSession()
      • getNumberOfFlashTokensInSession

        public Integer getNumberOfFlashTokensInSession()
      • isSupportEL3ImportHandler

        public boolean isSupportEL3ImportHandler()
      • isStrictJsf2OriginHeaderAppPath

        public boolean isStrictJsf2OriginHeaderAppPath()
      • getResourceBufferSize

        public int getResourceBufferSize()
      • isUseCdiForAnnotationScanning

        public boolean isUseCdiForAnnotationScanning()
      • isResourceHandlerCacheEnabled

        public boolean isResourceHandlerCacheEnabled()
      • getResourceHandlerCacheSize

        public int getResourceHandlerCacheSize()
      • getScanPackages

        public String getScanPackages()
      • getWebsocketMaxIdleTimeout

        public long getWebsocketMaxIdleTimeout()
      • getWebsocketEndpointPort

        public Integer getWebsocketEndpointPort()
      • getClientViewStateTimeout

        public long getClientViewStateTimeout()
      • getRandomKeyInViewStateSessionToken

        public String getRandomKeyInViewStateSessionToken()
      • getRandomKeyInViewStateSessionTokenLength

        public int getRandomKeyInViewStateSessionTokenLength()
      • getRandomKeyInViewStateSessionTokenSecureRandomClass

        public String getRandomKeyInViewStateSessionTokenSecureRandomClass()
      • getRandomKeyInViewStateSessionTokenSecureRandomProvider

        public String getRandomKeyInViewStateSessionTokenSecureRandomProvider()
      • getRandomKeyInViewStateSessionTokenSecureRandomAlgorithm

        public String getRandomKeyInViewStateSessionTokenSecureRandomAlgorithm()
      • getRandomKeyInCsrfSessionToken

        public String getRandomKeyInCsrfSessionToken()
      • isSerializeStateInSession

        public boolean isSerializeStateInSession()
      • isCompressStateInSession

        public boolean isCompressStateInSession()
      • isUseFlashScopePurgeViewsInSession

        public boolean isUseFlashScopePurgeViewsInSession()
      • isAutocompleteOffViewState

        public boolean isAutocompleteOffViewState()
      • getResourceMaxTimeExpires

        public long getResourceMaxTimeExpires()
      • isLazyLoadConfigObjects

        public boolean isLazyLoadConfigObjects()
      • getElResolverComparator

        public String getElResolverComparator()
      • getElResolverPredicate

        public String getElResolverPredicate()
      • getViewIdCacheSize

        public int getViewIdCacheSize()
      • isBeanBeforeJsfValidation

        public boolean isBeanBeforeJsfValidation()
      • getRandomKeyInWebsocketSessionToken

        public String getRandomKeyInWebsocketSessionToken()
      • getFacesInitPlugins

        public String getFacesInitPlugins()
      • isInitializeSkipJarFacesConfigScan

        public boolean isInitializeSkipJarFacesConfigScan()
      • getExpressionFactory

        public String getExpressionFactory()
      • getCheckIdProductionMode

        public String getCheckIdProductionMode()
      • isPartialStateSaving

        public boolean isPartialStateSaving()
      • getFullStateSavingViewIds

        public String[] getFullStateSavingViewIds()
      • getFaceletsBufferSize

        public int getFaceletsBufferSize()
      • isMarkInitialStateWhenApplyBuildView

        public boolean isMarkInitialStateWhenApplyBuildView()
      • getViewSuffix

        public String[] getViewSuffix()
      • getFaceletsViewMappings

        public String[] getFaceletsViewMappings()
      • getFaceletsViewSuffix

        public String getFaceletsViewSuffix()
      • isViewIdExistsCacheEnabled

        public boolean isViewIdExistsCacheEnabled()
      • isViewIdProtectedCacheEnabled

        public boolean isViewIdProtectedCacheEnabled()
      • isViewIdDeriveCacheEnabled

        public boolean isViewIdDeriveCacheEnabled()
      • isWrapTagExceptionsAsContextAware

        public boolean isWrapTagExceptionsAsContextAware()
      • isResourceCacheLastModified

        public boolean isResourceCacheLastModified()
      • isLogWebContextParams

        public boolean isLogWebContextParams()
      • getWebsocketMaxConnections

        public int getWebsocketMaxConnections()
      • isRenderClientBehaviorScriptsAsString

        public boolean isRenderClientBehaviorScriptsAsString()
      • isAlwaysForceSessionCreation

        public boolean isAlwaysForceSessionCreation()
      • isAutomaticExtensionlessMapping

        public boolean isAutomaticExtensionlessMapping()
      • getNumberOfClientWindows

        public Integer getNumberOfClientWindows()
      • isElResolverTracing

        public boolean isElResolverTracing()