Skip to content

Commit

Permalink
Fix form value hidden by a value in page context
Browse files Browse the repository at this point in the history
Sometimes Page context resolver goes before the general resolver. 
If it contains the same property (e.g. with null value) then it hides the value in other sources. 
This fix sets the value from the form also to page context so that it's not covered.
Fixes a bug in GlassFish Admin Console for some form values.
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
  • Loading branch information
OndroMih committed May 26, 2023
1 parent edaefc9 commit 9eb2f0f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ public Class<?> getType(ELContext elContext, Object base, Object property) {
@Override
public void setValue(ELContext elContext, Object base, Object property, Object value) {
checkPropertyFound(base, property);

FacesContext facesContext = (FacesContext) elContext.getContext(FacesContext.class);
UIViewRoot viewRoot = facesContext.getViewRoot();
Map pageSession = getPageSession(facesContext, viewRoot);
if (pageSession != null) {
pageSession.put(property.toString(), value);
}
}

@Override
Expand Down

0 comments on commit 9eb2f0f

Please sign in to comment.