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:
- https://wikis.oracle.com/display/GlassFish/JavaServerFacesRI#JavaServerFacesRI-Whatcontextparametersareavailableandwhatdotheydo%3F
- http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html/jsf.reference.html
- 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
Conversation/Validation
- com.sun.faces.writeStateAtFormEnd
- com.sun.faces.enableLazyBeanValidation
- com.sun.faces.registerConverterPropertyEditors
Misc
- 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.ENABLE_HTTP_METHOD_RESTRICTION_PHASE_LISTENER
- com.sun.faces.numberOfConcerrentFlashUsers
- mind the typo ;-)
- com.sun.faces.numberOfFlashesBetweenFlashReapings

