Details
Description
Hello,
When retrieving the functionMapper from the ELContext, null is returned.
FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); FunctionMapper functionMapper = elContext.getFunctionMapper()
A sample application is also attached. It works with the reference implementation, but not with MyFaces.
After looking over the code, I noticed that FacesELContext is not initialized with a default function mapper, and the FacesELContext#setFunctionMapper was never called. I addressed this by setFunctionMapper in the NamespaceHandler. Please let me know if you have any improvements to this fix. The behavior with my fix matches how the reference implementation behaves.
Additionally, this fix worked for version 2.2, but version 2.3 needed another change with the partialStateSavingDefault variable. I believe It's to false by accident when it's checked here:
partialStateSavingDefault = "2.0".equals(facesVersion) || "2.1".equals(facesVersion) || "2.2".equals(facesVersion) || (facesVersion == null);
I wasn't sure whether to add "2.3".equals(facesVersion), but I thought it would be better to create a default state variable and keep it within the StateManager. Please advice if this change should also be applied to 3.0 & master?
Thank you