myfaces-dev mailing list archives

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


Leonardo Uribe updated MYFACES-4041:
    Status: Patch Available  (was: Open)

> EL evaluation fails when state is saved because FaceletState object is not present
> ----------------------------------------------------------------------------------
>                 Key: MYFACES-4041
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-344
>    Affects Versions: 2.2.9
>            Reporter: Martin Marinschek
>            Assignee: Leonardo Uribe
>            Priority: Blocker
>             Fix For: 2.2.10
> DefaultFaceletsStateManagementStrategy.saveView(...) contains some lines of code that
do this:
> {code:java}
>                 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
>                     view.getAttributes().remove(ComponentSupport.FACELET_STATE_INSTANCE);
>                 }
> {code}
> 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