/** * Gets the String init parameter value from the specified context. If the parameter is an empty String or a String * containing only white space, this method returns <code>null</code> * * @param context * the application's external context * @param names * the init parameter's names, the first one is scanned first. Usually used when a param has multiple aliases * * @return the parameter if it was specified and was not empty, <code>null</code> otherwise * * @throws NullPointerException * if context or name is <code>null</code> */ public static String getStringInitParameter(ExternalContext context, String[] names) { return getStringInitParameter(context, names, null); }
/** * Gets the String init parameter value from the specified context. If the parameter is an empty String or a String * containing only white space, this method returns <code>null</code> * * @param context * the application's external context * @param names * the init parameter's names, the first one is scanned first. Usually used when a param has multiple aliases * * @return the parameter if it was specified and was not empty, <code>null</code> otherwise * * @throws NullPointerException * if context or name is <code>null</code> */ public static String getStringInitParameter(ExternalContext context, String[] names) { return getStringInitParameter(context, names, null); }
/** * Gets the String init parameter value from the specified context. If the parameter is an empty String or a String * containing only white space, this method returns <code>null</code> * * @param context * the application's external context * @param name * the init parameter's name * * @return the parameter if it was specified and was not empty, <code>null</code> otherwise * * @throws NullPointerException * if context or name is <code>null</code> */ public static String getStringInitParameter(ExternalContext context, String name) { return getStringInitParameter(context,name,null); }
/** * Gets the String init parameter value from the specified context. If the parameter is an empty String or a String * containing only white space, this method returns <code>null</code> * * @param context * the application's external context * @param name * the init parameter's name * * @return the parameter if it was specified and was not empty, <code>null</code> otherwise * * @throws NullPointerException * if context or name is <code>null</code> */ public static String getStringInitParameter(ExternalContext context, String name) { return getStringInitParameter(context,name,null); }
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
throw new NullPointerException(); String param = getStringInitParameter(context, name); if (param == null)
/** * Try to load user-definied ExpressionFactory. Returns <code>null</code>, * if no custom ExpressionFactory was specified. * * @param externalContext the current ExternalContext * @return User-specified ExpressionFactory, or * <code>null</code>, if no no custom implementation was specified */ protected static ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext) { String expressionFactoryClassName = WebConfigParamUtils.getStringInitParameter(externalContext, EXPRESSION_FACTORY); if (expressionFactoryClassName != null && expressionFactoryClassName.trim().length() > 0) { if (log.isLoggable(Level.FINE)) { log.fine("Attempting to load the ExpressionFactory implementation " + "you've specified: '" + expressionFactoryClassName + "'."); } return loadExpressionFactory(expressionFactoryClassName); } return null; }
/** * Try to load user-definied ExpressionFactory. Returns <code>null</code>, * if no custom ExpressionFactory was specified. * * @param externalContext the current ExternalContext * @return User-specified ExpressionFactory, or * <code>null</code>, if no no custom implementation was specified */ protected static ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext) { String expressionFactoryClassName = WebConfigParamUtils.getStringInitParameter(externalContext, EXPRESSION_FACTORY); if (expressionFactoryClassName != null && expressionFactoryClassName.trim().length() > 0) { if (log.isLoggable(Level.FINE)) { log.fine("Attempting to load the ExpressionFactory implementation " + "you've specified: '" + expressionFactoryClassName + "'."); } return loadExpressionFactory(expressionFactoryClassName); } return null; }
/** * Load the various decorators for Facelets. * * @param context * the current FacesContext * @param compiler * the page compiler */ protected void loadDecorators(FacesContext context, Compiler compiler) { String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATORS); if (param != null) { for (String decorator : param.split(";")) { try { compiler.addTagDecorator((TagDecorator) ReflectionUtil.forName(decorator).newInstance()); if (log.isLoggable(Level.FINE)) { log.fine("Successfully loaded decorator: " + decorator); } } catch (Exception e) { log.log(Level.SEVERE, "Error Loading decorator: " + decorator, e); } } } }
/** * Load the various decorators for Facelets. * * @param context * the current FacesContext * @param compiler * the page compiler */ protected void loadDecorators(FacesContext context, Compiler compiler) { String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATORS); if (param != null) { for (String decorator : param.split(";")) { try { compiler.addTagDecorator((TagDecorator) ReflectionUtil.forName(decorator).newInstance()); if (log.isLoggable(Level.FINE)) { log.fine("Successfully loaded decorator: " + decorator); } } catch (Exception e) { log.log(Level.SEVERE, "Error Loading decorator: " + decorator, e); } } } }
public CompositeResourceLibrary() { super(); ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); _acceptPatterns = loadAcceptPattern(externalContext); _extension = loadFaceletExtension(externalContext); String defaultSuffixes = WebConfigParamUtils.getStringInitParameter(externalContext, ViewHandler.DEFAULT_SUFFIX_PARAM_NAME, ViewHandler.DEFAULT_SUFFIX ); _defaultSuffixesArray = StringUtils.splitShortString(defaultSuffixes, ' '); boolean faceletsExtensionFound = false; for (String ext : _defaultSuffixesArray) { if (_extension.equals(ext)) { faceletsExtensionFound = true; break; } } if (!faceletsExtensionFound) { _defaultSuffixesArray = (String[]) ArrayUtils.concat(_defaultSuffixesArray, new String[]{_extension}); } }
public static <T> T getInstanceInitParameter(ExternalContext context, String name, String deprecatedName, T defaultValue) String param = getStringInitParameter(context, name, deprecatedName); if (param == null)
String faceletsResourceResolverClassName = WebConfigParamUtils.getStringInitParameter(eContext, PARAMS_RESOURCE_RESOLVER, null); if (faceletsResourceResolverClassName != null)
String faceletsResourceResolverClassName = WebConfigParamUtils.getStringInitParameter(eContext, PARAMS_RESOURCE_RESOLVER, null); if (faceletsResourceResolverClassName != null)
StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, partialStateSavingDefault); String [] viewIds = StringUtils.splitShortString(WebConfigParamUtils.getStringInitParameter(context, StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME), ',');
StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, partialStateSavingDefault); String [] viewIds = StringUtils.splitShortString(WebConfigParamUtils.getStringInitParameter(context, StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME), ',');