public final class JsfUtil extends Object
Modifier and Type | Method and Description |
---|---|
static javax.faces.application.Application |
getApplication()
Convenience method to get the application.
|
static Map<String,Object> |
getApplicationMap()
Convenience method to get the application map.
|
static String |
getContextParameter(String name)
Convenience method to get a context parameter.
|
static javax.el.ELContext |
getELContext()
Convenience method to get the expression language context.
|
static javax.faces.context.ExternalContext |
getExternalContext()
Convenience method to get the external context.
|
static javax.faces.context.FacesContext |
getFacesContext()
Convenience method to get the faces context.
|
static Object |
getObjectFromApplication(String key)
Gets an Object from the current application.
|
static Long |
getObjectIdFromActionEvent(javax.faces.event.ActionEvent actionEvent)
Gets the Object ID from the supplied actionEvent.
|
static javax.faces.component.UIViewRoot |
getViewRoot()
Convenience method to get the ui view root.
|
static boolean |
isUserInRole(String role)
Determines if the currently logged in user (if any) is in the supplied
role.
|
static boolean |
isUserLoggedIn()
Determines if there is a currently logged in user.
|
static String |
toString(javax.faces.event.PhaseEvent phaseEvent)
Creates a String representation of the supplied phaseEvent.
|
public static javax.faces.context.FacesContext getFacesContext()
public static javax.faces.component.UIViewRoot getViewRoot()
public static javax.el.ELContext getELContext()
public static javax.faces.context.ExternalContext getExternalContext()
public static Map<String,Object> getApplicationMap()
public static String getContextParameter(String name)
name
- The name of the context parameter.IllegalArgumentException
- When the supplied name is empty.NullPointerException
- When the supplied name is null.public static Long getObjectIdFromActionEvent(javax.faces.event.ActionEvent actionEvent)
actionEvent
- The event from which the Object ID must be retrieved.NullPointerException
- When the supplied ectionEvent is null.public static javax.faces.application.Application getApplication()
public static Object getObjectFromApplication(String key)
key
- The key of the object to get.public static boolean isUserInRole(String role)
role
- The role to check.public static boolean isUserLoggedIn()
public static String toString(javax.faces.event.PhaseEvent phaseEvent)
phaseEvent
- The phaseEvent to create a String representation of.Copyright © 2008–2018. All rights reserved.