Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,13 @@ public class MyfacesConfig
public static final String EXCEPTION_TYPES_TO_IGNORE_IN_LOGGING =
"org.apache.myfaces.EXCEPTION_TYPES_TO_IGNORE_IN_LOGGING";

/**
* Expression Language 6.0's OptionalELResolver is enabled by default, so this option allows us to disable it.
*/
@JSFWebConfigParam(name="org.apache.myfaces.DISABLE_OPTIONAL_EL_RESOLVER", since="4.1.2", defaultValue = "false")
public static final String DISABLE_OPTIONAL_EL_RESOLVER = "org.apache.myfaces.DISABLE_OPTIONAL_EL_RESOLVER";
public static final boolean DISABLE_OPTIONAL_EL_RESOLVER_DEFAULT = false;

// we need it, applicationImpl not ready probably
private ProjectStage projectStage = ProjectStage.Production;
private boolean strictJsf2AllowSlashLibraryName;
Expand Down Expand Up @@ -870,7 +877,8 @@ public class MyfacesConfig
private boolean elResolverTracing = EL_RESOLVER_TRACING_DEFAULT;
private long faceletsRefreshPeriod = -1;
private List<String> exceptionTypesToIgnoreInLogging = new ArrayList<>();

private boolean disableOptionalResolver = DISABLE_OPTIONAL_EL_RESOLVER_DEFAULT;

private static final boolean MYFACES_IMPL_AVAILABLE;
private static final boolean RI_IMPL_AVAILABLE;

Expand Down Expand Up @@ -1345,6 +1353,9 @@ else if (refreshTransientBuildOnPSS.equalsIgnoreCase("true") ||
cfg.exceptionTypesToIgnoreInLogging.add(exceptionTypeToIgnoreInLogging);
}
}

cfg.disableOptionalResolver
= getBoolean(extCtx, DISABLE_OPTIONAL_EL_RESOLVER, DISABLE_OPTIONAL_EL_RESOLVER_DEFAULT);

return cfg;
}
Expand Down Expand Up @@ -1815,5 +1826,10 @@ public List<String> getExceptionTypesToIgnoreInLogging()
{
return exceptionTypesToIgnoreInLogging;
}

public boolean isOptionalELResolverDisabled()
{
return disableOptionalResolver;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ public void build(FacesContext facesContext, CompositeELResolver compositeElReso
{
try
{
list.add(new OptionalELResolver());
if(!config.isOptionalELResolverDisabled())
{
list.add(new OptionalELResolver()); // not disabled (default), so add it in.
}
list.add(new RecordELResolver());
}
catch (Throwable ex)
Expand Down