public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) { if (param == null) { return; } boolean oldVal = booleanContextParameters.put(param, value); if (LOGGER.isLoggable(Level.FINE) && oldVal != value) { LOGGER.log(Level.FINE, "Overriding init parameter {0}. Changing from {1} to {2}.", new Object[] { param.getQualifiedName(), oldVal, value}); } }
public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) { if (param == null) { return; } boolean oldVal = booleanContextParameters.put(param, value); if (LOGGER.isLoggable(FINE) && oldVal != value) { LOGGER.log(FINE, "Overriding init parameter {0}. Changing from {1} to {2}.", new Object[] { param.getQualifiedName(), oldVal, value}); } } /**
public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) { if (param == null) { return; } boolean oldVal = booleanContextParameters.put(param, value); if (LOGGER.isLoggable(FINE) && oldVal != value) { LOGGER.log(FINE, "Overriding init parameter {0}. Changing from {1} to {2}.", new Object[] { param.getQualifiedName(), oldVal, value}); } } /**
/** * <p>Is the configured value valid against the default boolean pattern.</p> * @param param the boolean parameter * @param value the configured value * @return <code>true</code> if the value is valid, * otherwise <code>false</code> */ private boolean isValueValid(BooleanWebContextInitParameter param, String value) { if (!ALLOWABLE_BOOLEANS.matcher(value).matches()) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "jsf.config.webconfig.boolconfig.invalidvalue", new Object[]{ value, param.getQualifiedName(), "true|false", "true|false", param.getDefaultValue() }); } return false; } return true; }
private void savePerRequestInitParams(FacesContext context, WebConfiguration webConfig) { ExternalContext extContext = context.getExternalContext(); Map<String, Object> appMap = extContext.getApplicationMap(); String val = extContext.getInitParameter(UIComponent.HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME); boolean setCurrentComponent = Boolean.valueOf(val); Map<Object, Object> attrs = context.getAttributes(); attrs.put(UIInput.ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE, webConfig.isOptionEnabled(AlwaysPerformValidationWhenRequiredTrue) ? Boolean.TRUE : Boolean.FALSE); attrs.put(UIComponent.HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, setCurrentComponent ? Boolean.TRUE : Boolean.FALSE); attrs.put(PartialStateSaving, webConfig.isOptionEnabled(PartialStateSaving) ? Boolean.TRUE : Boolean.FALSE); attrs.put(ForceAlwaysWriteFlashCookie, webConfig.isOptionEnabled(ForceAlwaysWriteFlashCookie) ? Boolean.TRUE : Boolean.FALSE); // We must use getQualifiedName here because the consumer is in jsf-api // and thus cannot import the enum. attrs.put(ViewRootPhaseListenerQueuesException.getQualifiedName(), webConfig.isOptionEnabled(ViewRootPhaseListenerQueuesException) ? Boolean.TRUE : Boolean.FALSE); attrs.put(EnableValidateWholeBean.getQualifiedName(), webConfig.isOptionEnabled(EnableValidateWholeBean) ? Boolean.TRUE : Boolean.FALSE); Object nonDefaultResourceResolver = extContext.getApplicationMap().get(DefaultResourceResolver.NON_DEFAULT_RESOURCE_RESOLVER_PARAM_NAME); if (null != nonDefaultResourceResolver) { attrs.put(DefaultResourceResolver.NON_DEFAULT_RESOURCE_RESOLVER_PARAM_NAME, nonDefaultResourceResolver); } String facesConfigVersion = "" + appMap.get(RIConstants.FACES_CONFIG_VERSION); attrs.put(RIConstants.FACES_CONFIG_VERSION, facesConfigVersion); }
/** * <p>Is the configured value valid against the default boolean pattern.</p> * @param param the boolean parameter * @param value the configured value * @return <code>true</code> if the value is valid, * otherwise <code>false</code> */ private boolean isValueValid(BooleanWebContextInitParameter param, String value) { if (!ALLOWABLE_BOOLEANS.matcher(value).matches()) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "jsf.config.webconfig.boolconfig.invalidvalue", new Object[]{ value, param.getQualifiedName(), "true|false" }); } return false; } return true; }
@Override public boolean tagLibraryForNSExists(String toTest) { boolean result = false; String resourceId = null; if (null != (resourceId = getCompositeComponentLibraryName(toTest))) { if (enableMissingResourceLibraryDetection) { result = FacesContext.getCurrentInstance().getApplication(). getResourceHandler().libraryExists(resourceId); } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Skipping call to libraryExists(). Please set context-param {0} to true to verify if library {1} actually exists", new Object[]{EnableMissingResourceLibraryDetection.getQualifiedName(), toTest}); } result = true; } } return result; }
@Override public boolean tagLibraryForNSExists(String toTest) { boolean result = false; String resourceId = null; if (null != (resourceId = getCompositeComponentLibraryName(toTest))) { if (enableMissingResourceLibraryDetection) { result = FacesContext.getCurrentInstance().getApplication(). getResourceHandler().libraryExists(resourceId); } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Skipping call to libraryExists(). Please set context-param {0} to true to verify if library {1} actually exists", new Object[]{EnableMissingResourceLibraryDetection.getQualifiedName(), toTest}); } result = true; } } return result; }
@Override public boolean tagLibraryForNSExists(String toTest) { boolean result = false; String resourceId = null; if (null != (resourceId = getCompositeComponentLibraryName(toTest))) { if (enableMissingResourceLibraryDetection) { result = FacesContext.getCurrentInstance().getApplication(). getResourceHandler().libraryExists(resourceId); } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Skipping call to libraryExists(). Please set context-param {0} to true to verify if library {1} actually exists", new Object[]{EnableMissingResourceLibraryDetection.getQualifiedName(), toTest}); } result = true; } } return result; }
@Override public boolean tagLibraryForNSExists(String toTest) { boolean result = false; String resourceId = null; if (null != (resourceId = getCompositeComponentLibraryName(toTest))) { if (enableMissingResourceLibraryDetection) { result = FacesContext.getCurrentInstance().getApplication(). getResourceHandler().libraryExists(resourceId); } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Skipping call to libraryExists(). Please set context-param {0} to true to verify if library {1} actually exists", new Object[]{EnableMissingResourceLibraryDetection.getQualifiedName(), toTest}); } result = true; } } return result; }
public ServletContextAdapter(ServletContext servletContext) { this.servletContext = servletContext; String paramValue = servletContext.getInitParameter(EnableTransitionTimeNoOpFlash.getQualifiedName()); if (paramValue != null) { isEnableTransitionTimeNoOpFlash = parseBoolean(paramValue); } }
/** * @param param the init parameter of interest * @return <code>true</code> if the parameter was explicitly set, * otherwise, <code>false</code> */ public boolean isSet(BooleanWebContextInitParameter param) { return isSet(param.getQualifiedName()); }
public ServletContextAdapter(ServletContext servletContext) { this.servletContext = servletContext; String paramValue = servletContext.getInitParameter(EnableTransitionTimeNoOpFlash.getQualifiedName()); if (paramValue != null) { isEnableTransitionTimeNoOpFlash = parseBoolean(paramValue); } }
public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) { if (param == null) { return; } boolean oldVal = booleanContextParameters.put(param, value); if (LOGGER.isLoggable(FINE) && oldVal != value) { LOGGER.log(FINE, "Overriding init parameter {0}. Changing from {1} to {2}.", new Object[] { param.getQualifiedName(), oldVal, value}); } } /**
/** * @param param the init parameter of interest * @return <code>true</code> if the parameter was explicitly set, * otherwise, <code>false</code> */ public boolean isSet(BooleanWebContextInitParameter param) { return isSet(param.getQualifiedName()); }
public ServletContextAdapter(ServletContext sc) { this.servletContext = sc; Object paramValue = sc.getInitParameter(WebConfiguration.BooleanWebContextInitParameter.EnableTransitionTimeNoOpFlash.getQualifiedName()); if (null != paramValue) { isEnableTransitionTimeNoOpFlash = Boolean.parseBoolean(paramValue.toString()); } }
/** * @param param the init parameter of interest * @return <code>true</code> if the parameter was explicitly set, * otherwise, <code>false</code> */ public boolean isSet(BooleanWebContextInitParameter param) { return isSet(param.getQualifiedName()); }
public ServletContextAdapter(ServletContext servletContext) { this.servletContext = servletContext; String paramValue = servletContext.getInitParameter(EnableTransitionTimeNoOpFlash.getQualifiedName()); if (paramValue != null) { isEnableTransitionTimeNoOpFlash = parseBoolean(paramValue); } }
/** * @param param the init parameter of interest * @return <code>true</code> if the parameter was explicitly set, * otherwise, <code>false</code> */ public boolean isSet(BooleanWebContextInitParameter param) { return isSet(param.getQualifiedName()); }
/** * @param param the init parameter of interest * @return <code>true</code> if the parameter was explicitly set, * otherwise, <code>false</code> */ public boolean isSet(BooleanWebContextInitParameter param) { return isSet(param.getQualifiedName()); }