@Typed public abstract class JsfUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FACES_CONTEXT_MANUAL_WRAPPER_KEY |
Modifier and Type | Method and Description |
---|---|
static String |
addParameters(javax.faces.context.ExternalContext externalContext,
String url,
boolean addRequestParameter,
boolean addPageParameter,
boolean encodeValues)
Adds the current request-parameters to the given url
|
static String |
encodeURLParameterValue(String value,
javax.faces.context.ExternalContext externalContext)
Encodes the given value using URLEncoder.encode() with the charset returned
from ExternalContext.getResponseCharacterEncoding().
|
static ResourceBundle |
getCustomFacesMessageBundle(Locale locale)
Exposes the (optional) custom message-bundle configured in the faces-config for the given
Locale |
static ResourceBundle |
getDefaultFacesMessageBundle(Locale locale)
Exposes the default message-bundle of jsf for the given
Locale |
static Set<RequestParameter> |
getParameters(javax.faces.context.ExternalContext externalContext,
boolean filterViewState,
boolean addRequestParameter,
boolean addPageParameter)
Exposes all request-parameters (including or excluding the view-state)
|
static <T> T |
getValueOfExpression(String expression,
Class<T> targetType) |
static String |
getValueOfExpressionAsString(String expression) |
static void |
registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
Adds the given
PhaseListener to the application |
static void |
resetCaches()
Resets all caches of the current request
|
static void |
resetConversationCache()
Resets the conversation cache of the current request
|
public static final String FACES_CONTEXT_MANUAL_WRAPPER_KEY
public static void resetConversationCache()
public static void resetCaches()
public static void registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
PhaseListener
to the applicationphaseListener
- current phase-listenerpublic static ResourceBundle getDefaultFacesMessageBundle(Locale locale)
Locale
locale
- current localpublic static ResourceBundle getCustomFacesMessageBundle(Locale locale)
Locale
locale
- current localpublic static String encodeURLParameterValue(String value, javax.faces.context.ExternalContext externalContext)
value
- value which should be encodedexternalContext
- current external-contextpublic static String addParameters(javax.faces.context.ExternalContext externalContext, String url, boolean addRequestParameter, boolean addPageParameter, boolean encodeValues)
externalContext
- current external-contexturl
- current urladdRequestParameter
- flag which indicates if the request params should be added or notaddPageParameter
- flag which indicates if the view params should be added or not ViewParameter
encodeValues
- flag which indicates if parameter values should be encoded or notpublic static Set<RequestParameter> getParameters(javax.faces.context.ExternalContext externalContext, boolean filterViewState, boolean addRequestParameter, boolean addPageParameter)
externalContext
- current external-contextfilterViewState
- flag which indicates if the view-state should be added or notaddRequestParameter
- flag which indicates if the request params should be added or notaddPageParameter
- flag which indicates if the view params should be added or not ViewParameter
public static <T> T getValueOfExpression(String expression, Class<T> targetType)
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.