JSF Configuration Context-Parameters

Finding the appropriate configuration parameters for your JSF application can be difficult: Some params are defined in the JSF specification (those start with ‘javax.faces‘) and thus are available in both implementations. Others are implementation specific and are exclusively available for Mojarra or MyFaces. Implementation specific params for Mojarra  start with ‘com.sun.faces‘, and with ‘org.apache.myfaces‘ for Apache MyFaces.

Some issues are targeted by similar params in both implementations, e.g. ‘org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION‘ and ‘com.sun.faces.numberOfViewsInSession‘. Though the parameter names indicate similar behavior, they default to different values: org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION defaults to 20 while com.sun.faces.numberOfViewsInSession defaults to 15. This is an obstacle when moving from one implementation to another but also for those working with different implementations in different projects.

Ok, so all we need to be able to configure our JSF applications properly is to look up the context params defined by the JSF specification and those additionally provided by the implemenation of our choice, right? Well, this is true for MyFaces, since all configuration params are nicely summed  up and described in the documentation.

Unfortunately, there is no comprehensive list of context-params for Mojarra, so it is required to consult various sources. Developers interested in Mojarra’s context paramters can find some (but not all) in the official Glassfish wiki, others in an outdated JBoss AS 6 documentation, in IBM’s knowledgebase or scattered in release notes

Due to the lack of official  documentation, I compiled a list of Mojarra spcefic context-params available at least for version 2.1.6. I was not able to find documentation for all params so feel free to add additional links in the comments.

Sources for Mojarra context-params:

  1. https://wikis.oracle.com/display/GlassFish/JavaServerFacesRI#JavaServerFacesRI-Whatcontextparametersareavailableandwhatdotheydo%3F
  2. http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html/jsf.reference.html
  3. http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Frweb_jsfengine.html

Resource Handling

  • com.sun.faces.enableMissingResourceLibraryDetection
  • com.sun.faces.enableThreading
    • http://javaserverfaces.java.net/nonav/rlnotes/2.0.0/whatsnew.html
    • http://java.net/jira/browse/JAVASERVERFACES-2385
    • Relevant when deploying to GAE
  • com.sun.faces.resourceUpdateCheckPeriod
    • http://javaserverfaces.java.net/nonav/rlnotes/2.0.4/whatsnew.html
  • com.sun.faces.resourceBufferSize

State Saving

  • com.sun.faces.numberOfViewsInSession
  • com.sun.faces.numberOfLogicalViews
  • com.sun.faces.compressViewState
  • com.sun.faces.serializeServerState
  • com.sun.faces.enableViewStateIdRendering
  • com.sun.faces.autoCompleteOffOnViewState
  • com.sun.faces.generateUniqueServerStateIds

JSF 1.x Legacy

  • com.sun.faces.disableVersionTracking
  • com.sun.faces.enabledLoadBundle11Compatibility
  • com.sun.faces.enableRestoreView11Compatibility


  • com.sun.faces.writeStateAtFormEnd
  • com.sun.faces.enableLazyBeanValidation
  • com.sun.faces.registerConverterPropertyEditors


  • com.sun.faces.preferXHTML
  • com.sun.faces.sendPoweredByHeader
  • com.sun.faces.verifyObjects
  • com.sun.faces.validateXml
  • com.sun.faces.displayConfiguration
  • com.sun.faces.injectionProvider
  • com.sun.faces.serializationProvider
  • com.sun.faces.responseBufferSize
  • com.sun.faces.clientStateWriteBufferSize
  • com.sun.faces.forceLoadConfiguration
  • com.sun.faces.enableHtmlTagLibValidator
  • com.sun.faces.enableCoreTagLibValidator
  • com.sun.faces.compressJavaScript
  • com.sun.faces.defaultResourceMaxAge
  • com.sun.faces.enableJSStyleHiding
  • com.sun.faces.enableScriptsInAttributeValues
  • com.sun.faces.enableGroovyScripting
  • com.sun.faces.expressionFactory

  • com.sun.faces.disableUnicodeEscaping

  • com.sun.faces.allowTextChildren
    • http://javaserverfaces.java.net/nonav/rlnotes/2.0.0/whatsnew.html
    • http://java.net/jira/browse/JAVASERVERFACES-1154
  • com.sun.faces.enableAgressiveSessionDirtying
    • http://javaserverfaces.java.net/nonav/rlnotes/2.0.4/whatsnew.html

No documentation found

  • com.sun.faces.cacheResourceModificationTimestamp
  • com.sun.faces.numberOfConcerrentFlashUsers
    • mind the typo ;-)
  • com.sun.faces.numberOfFlashesBetweenFlashReapings
Short URL for this post: https://blog.oio.de/lyglx
This entry was posted in Build, config and deploy, Java EE, Java Web Frameworks, Web as a Platform and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *