com.liferay.faces.util.context
Class FacesContextHelperUtil

java.lang.Object
  extended by com.liferay.faces.util.context.FacesContextHelperUtil

public final class FacesContextHelperUtil
extends Object

This class contains a set of static convenience methods that delegate to the corresponding methods on FacesContextHelper.

Author:
Neil Griffin

Constructor Summary
FacesContextHelperUtil()
           
 
Method Summary
static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId)
          Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.
static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.
static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.
static void addComponentErrorMessage(String clientId, String messageId)
          Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.
static void addComponentErrorMessage(String clientId, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.
static void addComponentErrorMessage(String clientId, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.
static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId)
          Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.
static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.
static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext, String clientId, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.
static void addComponentInfoMessage(String clientId, String messageId)
          Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.
static void addComponentInfoMessage(String clientId, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.
static void addComponentInfoMessage(String clientId, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.
static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext, String messageId)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.
static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.
static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.
static void addGlobalErrorMessage(String messageId)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.
static void addGlobalErrorMessage(String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.
static void addGlobalErrorMessage(String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.
static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext, String messageId)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.
static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext, String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.
static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext, String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.
static void addGlobalInfoMessage(String messageId)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.
static void addGlobalInfoMessage(String messageId, Object... arguments)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.
static void addGlobalInfoMessage(String messageId, Object argument)
          Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.
static void addGlobalSuccessInfoMessage()
          Adds a global information message to the current FacesContext with "your-request-processed-successfully" key as the messageId.
static void addGlobalSuccessInfoMessage(javax.faces.context.FacesContext facesContext)
          Adds a global information message to the current FacesContext with "your-request-processed-successfully" key as the messageId.
static void addGlobalUnexpectedErrorMessage()
          Adds a global error message to the current FacesContext with "an-unexpected-error-occurred" key as the messageId.
static void addGlobalUnexpectedErrorMessage(javax.faces.context.FacesContext facesContext)
          Adds a global error message to the current FacesContext with "an-unexpected-error-occurred" key as the messageId.
static void addMessage(javax.faces.context.FacesContext facesContext, String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addMessage(javax.faces.context.FacesContext facesContext, String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId, Object... arguments)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addMessage(javax.faces.context.FacesContext facesContext, String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId, Object argument)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId, Object... arguments)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addMessage(String clientId, javax.faces.application.FacesMessage.Severity severity, String messageId, Object argument)
          Adds the specified key as a message associated with the UIComponent that has the specified clientId.
static void addScript(javax.faces.context.FacesContext facesContext, Script script)
          Adds the specified Script to the list of scripts that are to be executed on the client.
static void addScript(javax.faces.context.FacesContext facesContext, String scriptString)
          Adds the specified script to the list of scripts that are to be executed on the client.
static void addScript(Script script)
          Adds the specified Script to the list of scripts that are to be executed on the client.
static void addScript(String scriptString)
          Adds the specified script to the list of scripts that are to be executed on the client.
 javax.faces.context.FacesContext getFacesContext()
          Deprecated. Call FacesContext.getCurrentInstance() instead.
static Locale getLocale()
          Returns the locale of the viewRoot of the current JSF FacesContext
static Locale getLocale(javax.faces.context.FacesContext facesContext)
          Returns the locale of the viewRoot of the current JSF FacesContext
static String getMessage(javax.faces.context.FacesContext facesContext, Locale locale, String messageId)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale.
static String getMessage(javax.faces.context.FacesContext facesContext, Locale locale, String messageId, Object... arguments)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale and arguments that are to be substituted.
static String getMessage(javax.faces.context.FacesContext facesContext, String messageId)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale.
static String getMessage(javax.faces.context.FacesContext facesContext, String messageId, Object... arguments)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale and arguments that are to be substituted.
static String getMessage(Locale locale, String messageId)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale.
static String getMessage(Locale locale, String messageId, Object... arguments)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale and arguments that are to be substituted.
static String getMessage(String messageId)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale.
static String getMessage(String messageId, Object... arguments)
          Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale and arguments that are to be substituted.
static String getNamespace()
          Delegates to the underlying ExternalContext.encodeNamespace(String) method in order to get the application namespace.
static String getNamespace(javax.faces.context.FacesContext facesContext)
          Delegates to the underlying ExternalContext.encodeNamespace(String) method in order to get the application namespace.
static javax.faces.component.UIForm getParentForm(javax.faces.component.UIComponent uiComponent)
          Returns the parent form of the given component or null if no parent form is found.
static Object getRequestAttribute(javax.faces.context.FacesContext facesContext, String name)
          Returns the value of the request attribute associated with the specified name.
static Object getRequestAttribute(String name)
          Returns the value of the request attribute associated with the specified name.
static String getRequestContextPath()
          Returns The request context path.
static String getRequestContextPath(javax.faces.context.FacesContext facesContext)
          Returns The request context path.
static String getRequestParameter(javax.faces.context.FacesContext facesContext, String name)
          Retrieves the specified parameter passed as part of the request
static String getRequestParameter(String name)
          Retrieves the specified parameter passed as part of the request
static boolean getRequestParameterAsBool(javax.faces.context.FacesContext facesContext, String name, boolean defaultValue)
          Retrieves the specified parameter passed as part of the request as a boolean.
static boolean getRequestParameterAsBool(String name, boolean defaultValue)
          Retrieves the specified parameter passed as part of the request as a boolean.
static int getRequestParameterAsInt(javax.faces.context.FacesContext facesContext, String name, int defaultValue)
          Retrieves the specified parameter passed as part of the request as an integer.
static int getRequestParameterAsInt(String name, int defaultValue)
          Retrieves the specified parameter passed as part of the request as an integer.
static long getRequestParameterAsLong(javax.faces.context.FacesContext facesContext, String name, long defaultValue)
          Retrieves the specified parameter passed as part of the request as an integer.
static long getRequestParameterAsLong(String name, long defaultValue)
          Retrieves the specified parameter passed as part of the request as an integer.
static String getRequestParameterFromMap(javax.faces.context.FacesContext facesContext, String name)
          Retrieves the specified parameter from the ExternalContext's request parameter map.
static String getRequestParameterFromMap(String name)
          Retrieves the specified parameter from the ExternalContext's request parameter map.
static Map<String,String> getRequestParameterMap()
          Returns the map of request parameters from the ExternalContext.
static Map<String,String> getRequestParameterMap(javax.faces.context.FacesContext facesContext)
          Returns the map of request parameters from the ExternalContext.
static String getRequestQueryString()
          Retrieves the value of the original "javax.servlet.forward.query_string" request attribute.
static String getRequestQueryString(javax.faces.context.FacesContext facesContext)
          Retrieves the value of the original "javax.servlet.forward.query_string" request attribute.
static String getRequestQueryStringParameter(javax.faces.context.FacesContext facesContext, String name)
          Retrieves the value of the specified parameter name from the original "javax.servlet.forward.query_string" request attribute.
static String getRequestQueryStringParameter(String name)
          Retrieves the value of the specified parameter name from the original "javax.servlet.forward.query_string" request attribute.
static List<Script> getScripts()
          Returns an immutable list of scripts that were added via the addScript(FacesContext,Script) or addScript(FacesContext,String) method.
static List<Script> getScripts(javax.faces.context.FacesContext facesContext)
          Returns an immutable list of scripts that were added via the addScript(FacesContext,Script) or addScript(FacesContext,String) method.
static Object getSession(boolean create)
          Returns the session object associated with the current FacesContext.
static Object getSession(javax.faces.context.FacesContext facesContext, boolean create)
          Returns the session object associated with the current FacesContext.
static Object getSessionAttribute(javax.faces.context.FacesContext facesContext, String name)
          Returns the value of the session attribute associated with the specified name.
static Object getSessionAttribute(String name)
          Returns the value of the session attribute associated with the specified name.
static javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent parent, String partialClientId)
          Traverses the component tree starting at the specified UIComponent parent and returns the first UIComponent child that contains the specified partialClientId.
static javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.component.UIComponent parent, String partialClientId)
          Traverses the component tree starting at the specified UIComponent parent and returns the first UIComponent child that contains the specified partialClientId.
static javax.faces.component.UIComponent matchComponentInViewRoot(javax.faces.context.FacesContext facesContext, String partialClientId)
          Traverses the component tree associated with the UIViewRoot of this FacesContext and returns the first UIComponent child that contains the specified partialClientId.
static javax.faces.component.UIComponent matchComponentInViewRoot(String partialClientId)
          Traverses the component tree associated with the UIViewRoot of this FacesContext and returns the first UIComponent child that contains the specified partialClientId.
static void navigate(javax.faces.context.FacesContext facesContext, String fromAction, String outcome)
          Sets the current JSF navigation to the specified outcome.
static void navigate(String fromAction, String outcome)
          Sets the current JSF navigation to the specified outcome.
static void navigateTo(javax.faces.context.FacesContext facesContext, String outcome)
          Sets the current JSF navigation to the specified outcome.
static void navigateTo(String outcome)
          Sets the current JSF navigation to the specified outcome.
static void recreateComponentTree()
          Delete the whole component tree.
static void recreateComponentTree(javax.faces.context.FacesContext facesContext)
          Delete the whole component tree.
static void registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
          Register a PhaseListener programatically (instead of in the faces-config.xml).
static void removeChildrenFromComponentTree(javax.faces.context.FacesContext facesContext, String clientId)
          clear component tree since input fields will not be refreshed.
static void removeChildrenFromComponentTree(String clientId)
          clear component tree since input fields will not be refreshed.
static void removeMessages(javax.faces.context.FacesContext facesContext, String clientId)
          Removes all FacesMessage instances from this FacesContext that are associated with the specified clientId.
static void removeMessages(String clientId)
          Removes all FacesMessage instances from this FacesContext that are associated with the specified clientId.
static void removeMessagesForImmediateComponents()
          Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true.
static void removeMessagesForImmediateComponents(javax.faces.context.FacesContext facesContext)
          Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true.
static void removeMessagesForImmediateComponents(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
          Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true.
static void removeMessagesForImmediateComponents(javax.faces.component.UIComponent uiComponent)
          Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true.
static void removeParentFormFromComponentTree(javax.faces.component.UIComponent uiComponent)
          Delete the component subtree of a given component.
static void resetView()
          Causes the current view's component tree to be discarded and re-rendered.
static void resetView(boolean renderResponse)
          Causes the current view's component tree to be discarded and (optionally) re-rendered.
static void resetView(javax.faces.context.FacesContext facesContext)
          Causes the current view's component tree to be discarded and re-rendered.
static void resetView(javax.faces.context.FacesContext facesContext, boolean renderResponse)
          Causes the current view's component tree to be discarded and (optionally) re-rendered.
static Object resolveExpression(javax.faces.context.FacesContext facesContext, String elExpression)
          Returns the object associated with the specified EL expression.
static Object resolveExpression(String elExpression)
          Returns the object associated with the specified EL expression.
static void setRequestAttribute(javax.faces.context.FacesContext facesContext, String name, Object value)
          Sets the value of the a request attribute using the specified name and value.
static void setRequestAttribute(String name, Object value)
          Sets the value of the a request attribute using the specified name and value.
static void setSessionAttribute(javax.faces.context.FacesContext facesContext, String name, Object value)
          Sets the value of the a session attribute using the specified name and value.
static void setSessionAttribute(String name, Object value)
          Sets the value of the a session attribute using the specified name and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesContextHelperUtil

public FacesContextHelperUtil()
Method Detail

addComponentErrorMessage

public static void addComponentErrorMessage(String clientId,
                                            String messageId)
Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentErrorMessage

public static void addComponentErrorMessage(String clientId,
                                            String messageId,
                                            Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentErrorMessage

public static void addComponentErrorMessage(String clientId,
                                            String messageId,
                                            Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentErrorMessage

public static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext,
                                            String clientId,
                                            String messageId)
Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentErrorMessage

public static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext,
                                            String clientId,
                                            String messageId,
                                            Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentErrorMessage

public static void addComponentErrorMessage(javax.faces.context.FacesContext facesContext,
                                            String clientId,
                                            String messageId,
                                            Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(String clientId,
                                           String messageId)
Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(String clientId,
                                           String messageId,
                                           Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(String clientId,
                                           String messageId,
                                           Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext,
                                           String clientId,
                                           String messageId)
Adds the specified key as a message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext,
                                           String clientId,
                                           String messageId,
                                           Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addComponentInfoMessage

public static void addComponentInfoMessage(javax.faces.context.FacesContext facesContext,
                                           String clientId,
                                           String messageId,
                                           Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key. The message will not be global, rather it will be associated with the javax.faces.component.UIComponent that is associated with the specified clientId.


addGlobalErrorMessage

public static void addGlobalErrorMessage(String messageId)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.


addGlobalErrorMessage

public static void addGlobalErrorMessage(String messageId,
                                         Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.


addGlobalErrorMessage

public static void addGlobalErrorMessage(String messageId,
                                         Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.


addGlobalErrorMessage

public static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext,
                                         String messageId)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR.


addGlobalErrorMessage

public static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext,
                                         String messageId,
                                         Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument for the tokens in the specified key.


addGlobalErrorMessage

public static void addGlobalErrorMessage(javax.faces.context.FacesContext facesContext,
                                         String messageId,
                                         Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_ERROR and substitutes the specified argument(s) for the tokens in the specified key.


addGlobalInfoMessage

public static void addGlobalInfoMessage(String messageId)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.


addGlobalInfoMessage

public static void addGlobalInfoMessage(String messageId,
                                        Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.


addGlobalInfoMessage

public static void addGlobalInfoMessage(String messageId,
                                        Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.


addGlobalInfoMessage

public static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext,
                                        String messageId)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO.


addGlobalInfoMessage

public static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext,
                                        String messageId,
                                        Object argument)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument for the tokens in the specified key.


addGlobalInfoMessage

public static void addGlobalInfoMessage(javax.faces.context.FacesContext facesContext,
                                        String messageId,
                                        Object... arguments)
Adds the specified key as a global message to the FacesContext with severity javax.faces.application.FacesMessage.SEVERITY_INFO and substitutes the specified argument(s) for the tokens in the specified key.


addGlobalSuccessInfoMessage

public static void addGlobalSuccessInfoMessage()
Adds a global information message to the current FacesContext with "your-request-processed-successfully" key as the messageId.


addGlobalSuccessInfoMessage

public static void addGlobalSuccessInfoMessage(javax.faces.context.FacesContext facesContext)
Adds a global information message to the current FacesContext with "your-request-processed-successfully" key as the messageId.


addGlobalUnexpectedErrorMessage

public static void addGlobalUnexpectedErrorMessage()
Adds a global error message to the current FacesContext with "an-unexpected-error-occurred" key as the messageId.


addGlobalUnexpectedErrorMessage

public static void addGlobalUnexpectedErrorMessage(javax.faces.context.FacesContext facesContext)
Adds a global error message to the current FacesContext with "an-unexpected-error-occurred" key as the messageId.


addMessage

public static void addMessage(String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addMessage

public static void addMessage(String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId,
                              Object argument)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addMessage

public static void addMessage(String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId,
                              Object... arguments)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addMessage

public static void addMessage(javax.faces.context.FacesContext facesContext,
                              String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addMessage

public static void addMessage(javax.faces.context.FacesContext facesContext,
                              String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId,
                              Object argument)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addMessage

public static void addMessage(javax.faces.context.FacesContext facesContext,
                              String clientId,
                              javax.faces.application.FacesMessage.Severity severity,
                              String messageId,
                              Object... arguments)
Adds the specified key as a message associated with the UIComponent that has the specified clientId. Specify clientId=null for global messages.


addScript

public static void addScript(Script script)
Adds the specified Script to the list of scripts that are to be executed on the client.

Parameters:
script - The script that is to be added.
Since:
3.2

addScript

public static void addScript(String scriptString)
Adds the specified script to the list of scripts that are to be executed on the client.

Parameters:
scriptString - The script that is to be added.
Since:
3.2

addScript

public static void addScript(javax.faces.context.FacesContext facesContext,
                             Script script)
Adds the specified Script to the list of scripts that are to be executed on the client.

Parameters:
facesContext - The current faces context.
script - The script that is to be added.
Since:
3.2

addScript

public static void addScript(javax.faces.context.FacesContext facesContext,
                             String scriptString)
Adds the specified script to the list of scripts that are to be executed on the client.

Parameters:
facesContext - The current faces context.
scriptString - The script that is to be added.
Since:
3.2

getLocale

public static Locale getLocale()
Returns the locale of the viewRoot of the current JSF FacesContext


getLocale

public static Locale getLocale(javax.faces.context.FacesContext facesContext)
Returns the locale of the viewRoot of the current JSF FacesContext


getMessage

public static String getMessage(String messageId)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale.


getMessage

public static String getMessage(String messageId,
                                Object... arguments)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale and arguments that are to be substituted.


getMessage

public static String getMessage(Locale locale,
                                String messageId)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale.


getMessage

public static String getMessage(javax.faces.context.FacesContext facesContext,
                                String messageId)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale.


getMessage

public static String getMessage(Locale locale,
                                String messageId,
                                Object... arguments)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale and arguments that are to be substituted.


getMessage

public static String getMessage(javax.faces.context.FacesContext facesContext,
                                String messageId,
                                Object... arguments)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the current locale and arguments that are to be substituted.


getMessage

public static String getMessage(javax.faces.context.FacesContext facesContext,
                                Locale locale,
                                String messageId)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale.


getMessage

public static String getMessage(javax.faces.context.FacesContext facesContext,
                                Locale locale,
                                String messageId,
                                Object... arguments)
Returns the message associated with the specified messageId by delegating to the FacesMessageFactory, according to the specified locale and arguments that are to be substituted.


getNamespace

public static String getNamespace()
Delegates to the underlying ExternalContext.encodeNamespace(String) method in order to get the application namespace.


getNamespace

public static String getNamespace(javax.faces.context.FacesContext facesContext)
Delegates to the underlying ExternalContext.encodeNamespace(String) method in order to get the application namespace.


getParentForm

public static javax.faces.component.UIForm getParentForm(javax.faces.component.UIComponent uiComponent)
Returns the parent form of the given component or null if no parent form is found.

Parameters:
uiComponent - The component whose parent is to be found.

getRequestAttribute

public static Object getRequestAttribute(String name)
Returns the value of the request attribute associated with the specified name.


getRequestAttribute

public static Object getRequestAttribute(javax.faces.context.FacesContext facesContext,
                                         String name)
Returns the value of the request attribute associated with the specified name.


getRequestContextPath

public static String getRequestContextPath()
Returns The request context path. FacesContext.getExternalContext() ExternalContext.getRequestContextPath()


getRequestContextPath

public static String getRequestContextPath(javax.faces.context.FacesContext facesContext)
Returns The request context path. FacesContext.getExternalContext() ExternalContext.getRequestContextPath()


getRequestParameter

public static String getRequestParameter(String name)
Retrieves the specified parameter passed as part of the request


getRequestParameter

public static String getRequestParameter(javax.faces.context.FacesContext facesContext,
                                         String name)
Retrieves the specified parameter passed as part of the request


getRequestParameterAsBool

public static boolean getRequestParameterAsBool(String name,
                                                boolean defaultValue)
Retrieves the specified parameter passed as part of the request as a boolean. The values "yes", "true", "y", and "1" are accetable values for "TRUE".


getRequestParameterAsBool

public static boolean getRequestParameterAsBool(javax.faces.context.FacesContext facesContext,
                                                String name,
                                                boolean defaultValue)
Retrieves the specified parameter passed as part of the request as a boolean. The values "yes", "true", "y", and "1" are accetable values for "TRUE".


getRequestParameterAsInt

public static int getRequestParameterAsInt(String name,
                                           int defaultValue)
Retrieves the specified parameter passed as part of the request as an integer.


getRequestParameterAsInt

public static int getRequestParameterAsInt(javax.faces.context.FacesContext facesContext,
                                           String name,
                                           int defaultValue)
Retrieves the specified parameter passed as part of the request as an integer.


getRequestParameterAsLong

public static long getRequestParameterAsLong(String name,
                                             long defaultValue)
Retrieves the specified parameter passed as part of the request as an integer.


getRequestParameterAsLong

public static long getRequestParameterAsLong(javax.faces.context.FacesContext facesContext,
                                             String name,
                                             long defaultValue)
Retrieves the specified parameter passed as part of the request as an integer.


getRequestParameterFromMap

public static String getRequestParameterFromMap(String name)
Retrieves the specified parameter from the ExternalContext's request parameter map.


getRequestParameterFromMap

public static String getRequestParameterFromMap(javax.faces.context.FacesContext facesContext,
                                                String name)
Retrieves the specified parameter from the ExternalContext's request parameter map.


getRequestParameterMap

public static Map<String,String> getRequestParameterMap()
Returns the map of request parameters from the ExternalContext.

See Also:
ExternalContext.getRequestParameterMap()

getRequestParameterMap

public static Map<String,String> getRequestParameterMap(javax.faces.context.FacesContext facesContext)
Returns the map of request parameters from the ExternalContext.

See Also:
ExternalContext.getRequestParameterMap()

getRequestQueryString

public static String getRequestQueryString()
Retrieves the value of the original "javax.servlet.forward.query_string" request attribute.


getRequestQueryString

public static String getRequestQueryString(javax.faces.context.FacesContext facesContext)
Retrieves the value of the original "javax.servlet.forward.query_string" request attribute.


getRequestQueryStringParameter

public static String getRequestQueryStringParameter(String name)
Retrieves the value of the specified parameter name from the original "javax.servlet.forward.query_string" request attribute.


getRequestQueryStringParameter

public static String getRequestQueryStringParameter(javax.faces.context.FacesContext facesContext,
                                                    String name)
Retrieves the value of the specified parameter name from the original "javax.servlet.forward.query_string" request attribute.


getScripts

public static List<Script> getScripts()
Returns an immutable list of scripts that were added via the addScript(FacesContext,Script) or addScript(FacesContext,String) method.

Since:
3.2

getScripts

public static List<Script> getScripts(javax.faces.context.FacesContext facesContext)
Returns an immutable list of scripts that were added via the addScript(FacesContext,Script) or addScript(FacesContext,String) method.

Parameters:
facesContext - The current faces context.
Since:
3.2

getSession

public static Object getSession(boolean create)
Returns the session object associated with the current FacesContext.

Parameters:
create - Flag indicating whether or not a session should be created if it doesn't yet exist.

getSession

public static Object getSession(javax.faces.context.FacesContext facesContext,
                                boolean create)
Returns the session object associated with the current FacesContext.

Parameters:
create - Flag indicating whether or not a session should be created if it doesn't yet exist.

getSessionAttribute

public static Object getSessionAttribute(String name)
Returns the value of the session attribute associated with the specified name.


getSessionAttribute

public static Object getSessionAttribute(javax.faces.context.FacesContext facesContext,
                                         String name)
Returns the value of the session attribute associated with the specified name.


matchComponentInHierarchy

public static javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.component.UIComponent parent,
                                                                          String partialClientId)
Traverses the component tree starting at the specified UIComponent parent and returns the first UIComponent child that contains the specified partialClientId.


matchComponentInHierarchy

public static javax.faces.component.UIComponent matchComponentInHierarchy(javax.faces.context.FacesContext facesContext,
                                                                          javax.faces.component.UIComponent parent,
                                                                          String partialClientId)
Traverses the component tree starting at the specified UIComponent parent and returns the first UIComponent child that contains the specified partialClientId.


matchComponentInViewRoot

public static javax.faces.component.UIComponent matchComponentInViewRoot(String partialClientId)
Traverses the component tree associated with the UIViewRoot of this FacesContext and returns the first UIComponent child that contains the specified partialClientId.


matchComponentInViewRoot

public static javax.faces.component.UIComponent matchComponentInViewRoot(javax.faces.context.FacesContext facesContext,
                                                                         String partialClientId)
Traverses the component tree associated with the UIViewRoot of this FacesContext and returns the first UIComponent child that contains the specified partialClientId.


navigate

public static void navigate(String fromAction,
                            String outcome)
Sets the current JSF navigation to the specified outcome.

Parameters:
fromAction - The "from action" as specified in a JSF navigation rule. Can be null to if no action is specified in the rule.
outcome - The "from outcome" as specified in a JSF navigation rule

navigate

public static void navigate(javax.faces.context.FacesContext facesContext,
                            String fromAction,
                            String outcome)
Sets the current JSF navigation to the specified outcome.

Parameters:
fromAction - The "from action" as specified in a JSF navigation rule. Can be null to if no action is specified in the rule.
outcome - The "from outcome" as specified in a JSF navigation rule

navigateTo

public static void navigateTo(String outcome)
Sets the current JSF navigation to the specified outcome.

Parameters:
outcome - The "from outcome" as specified in a JSF navigation rule

navigateTo

public static void navigateTo(javax.faces.context.FacesContext facesContext,
                              String outcome)
Sets the current JSF navigation to the specified outcome.

Parameters:
outcome - The "from outcome" as specified in a JSF navigation rule

recreateComponentTree

public static void recreateComponentTree()
Delete the whole component tree. This causes the tree to be rebuilt the next time it is accessed. This addresses the problem that immediate actions cannot change the values of input components. To clear these values, use this method.


recreateComponentTree

public static void recreateComponentTree(javax.faces.context.FacesContext facesContext)
Delete the whole component tree. This causes the tree to be rebuilt the next time it is accessed. This addresses the problem that immediate actions cannot change the values of input components. To clear these values, use this method.


registerPhaseListener

public static void registerPhaseListener(javax.faces.event.PhaseListener phaseListener)
Register a PhaseListener programatically (instead of in the faces-config.xml). Such a PhaseListener can therefore be controlled by spring and use dependency injection, which is not possible otherwise.


removeChildrenFromComponentTree

public static void removeChildrenFromComponentTree(String clientId)
clear component tree since input fields will not be refreshed. See ClearInputComponents for more information.

Parameters:
clientId - all children of the component with this id are cleared.

removeChildrenFromComponentTree

public static void removeChildrenFromComponentTree(javax.faces.context.FacesContext facesContext,
                                                   String clientId)
clear component tree since input fields will not be refreshed. See ClearInputComponents for more information.

Parameters:
clientId - all children of the component with this id are cleared.

removeMessages

public static void removeMessages(String clientId)
Removes all FacesMessage instances from this FacesContext that are associated with the specified clientId.


removeMessages

public static void removeMessages(javax.faces.context.FacesContext facesContext,
                                  String clientId)
Removes all FacesMessage instances from this FacesContext that are associated with the specified clientId.


removeMessagesForImmediateComponents

public static void removeMessagesForImmediateComponents()
Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true. This happens because UIInput.processDecodes(javax.faces.context.FacesContext) calls validate() if the the immediate attribute is true.


removeMessagesForImmediateComponents

public static void removeMessagesForImmediateComponents(javax.faces.component.UIComponent uiComponent)
Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true. This happens because UIInput.processDecodes(javax.faces.context.FacesContext) calls validate() if the the immediate attribute is true.


removeMessagesForImmediateComponents

public static void removeMessagesForImmediateComponents(javax.faces.context.FacesContext facesContext)
Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true. This happens because UIInput.processDecodes(javax.faces.context.FacesContext) calls validate() if the the immediate attribute is true.


removeMessagesForImmediateComponents

public static void removeMessagesForImmediateComponents(javax.faces.context.FacesContext facesContext,
                                                        javax.faces.component.UIComponent uiComponent)
Removes all FacesMessage instances from this FacesContext that are associated with components whose immediate attribute is true.The typical use case for this method is when seemingly bogus messages are added to the FacesContext on components whose immediate attribute is true. This happens because UIInput.processDecodes(javax.faces.context.FacesContext) calls validate() if the the immediate attribute is true.


removeParentFormFromComponentTree

public static void removeParentFormFromComponentTree(javax.faces.component.UIComponent uiComponent)
Delete the component subtree of a given component. This causes the subtree to be rebuilt the next time it is accessed. This addresses the problem that immediate actions cannot change the values of input components. To clear these values, use this method.


resetView

public static void resetView()
Causes the current view's component tree to be discarded and re-rendered.

See Also:
FacesContextHelper.resetView(boolean)

resetView

public static void resetView(boolean renderResponse)
Causes the current view's component tree to be discarded and (optionally) re-rendered. This is useful whenever an action causes navigation back to the current view, but the data in the backing bean(s) has changed substantially. The view is rendered as if the user is visiting for the first time.

Parameters:
renderResponse - causes the response to be rendered immediately if true.
See Also:
ClearInputComponents

resetView

public static void resetView(javax.faces.context.FacesContext facesContext)
Causes the current view's component tree to be discarded and re-rendered.

See Also:
FacesContextHelper.resetView(boolean)

resetView

public static void resetView(javax.faces.context.FacesContext facesContext,
                             boolean renderResponse)
Causes the current view's component tree to be discarded and (optionally) re-rendered. This is useful whenever an action causes navigation back to the current view, but the data in the backing bean(s) has changed substantially. The view is rendered as if the user is visiting for the first time.

Parameters:
renderResponse - causes the response to be rendered immediately if true.
See Also:
ClearInputComponents

resolveExpression

public static Object resolveExpression(String elExpression)
Returns the object associated with the specified EL expression.


resolveExpression

public static Object resolveExpression(javax.faces.context.FacesContext facesContext,
                                       String elExpression)
Returns the object associated with the specified EL expression.


setRequestAttribute

public static void setRequestAttribute(String name,
                                       Object value)
Sets the value of the a request attribute using the specified name and value.


setRequestAttribute

public static void setRequestAttribute(javax.faces.context.FacesContext facesContext,
                                       String name,
                                       Object value)
Sets the value of the a request attribute using the specified name and value.


setSessionAttribute

public static void setSessionAttribute(String name,
                                       Object value)
Sets the value of the a session attribute using the specified name and value.


setSessionAttribute

public static void setSessionAttribute(javax.faces.context.FacesContext facesContext,
                                       String name,
                                       Object value)
Sets the value of the a session attribute using the specified name and value.


getFacesContext

@Deprecated
public javax.faces.context.FacesContext getFacesContext()
Deprecated. Call FacesContext.getCurrentInstance() instead.

Gets the underlying/wrapped FacesContext ThreadLocal singleton instance.



Copyright © 2019 Liferay, Inc.. All rights reserved.