myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] [Created] (MYFACES-4041) EL evaluation fails when state is saved because FaceletState object is not present
Date Mon, 04 Apr 2016 15:08:25 GMT
Leonardo Uribe created MYFACES-4041:

             Summary: EL evaluation fails when state is saved because FaceletState object
is not present
                 Key: MYFACES-4041
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-344
    Affects Versions: 2.2.9
            Reporter: Martin Marinschek
            Assignee: Leonardo Uribe
            Priority: Blocker

DefaultFaceletsStateManagementStrategy.saveView(...) contains some lines of code that do this:

                states = new HashMap<String, Object>();

                faceletViewState = view.getAttributes().get(ComponentSupport.FACELET_STATE_INSTANCE);
                if (faceletViewState != null)
                    ((Map<String, Object>)states).put(ComponentSupport.FACELET_STATE_INSTANCE,
                            UIComponentBase.saveAttachedState(context, faceletViewState));
                    //Do not save on UIViewRoot

The problem is FaceletState is removed to be serialized, but FaceletState is also used for
EL expressions (see FaceletStateValueExpression), so every EL expression that is evaluated
when the state is being saved that depends on this map throws NullPointerException.

The problem has been experienced by other users before (see MYFACES-4023 for details), but
in the case reported here (treeTable component and dynamic columns) there is no other possible
workaround than to preserve FaceletState object so the EL can be properly evaluated.

The solution is use the transient state helper map to hold FaceletState and change FaceletStateValueExpression
to scan for this condition.

This message was sent by Atlassian JIRA

View raw message