| java.lang.Object de.danet.an.util.jsf.JSFUtil
JSFUtil | public class JSFUtil (Code) | | This class provides some utility method for use with Java Server
Faces.
author: Michael Lipp version: $Revision: 1.13 $ |
Field Summary | |
final public static String | LIFECYCLE Attribute name for accessing lifecycle as request attribue. |
Method Summary | |
public static Locale | activeLocale() Return the active locale. | public static void | addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args) Add a message to the current faces context. | public static void | addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args, String detail) Add a message to the current faces context.
Parameters: severity - the message severity Parameters: baseName - the base name of the resource bundle with messages Parameters: key - the key of the message Parameters: args - arguments for message formatting Parameters: detail - detailed information. | public static void | addMessage(FacesMessage.Severity severity, Locale locale, String baseName, String key, Object[] args, Throwable thrown) Add a message to the current faces context. | public static void | addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args, Throwable thrown) Add a message to the current faces context. | public static void | addPhaseListenerForPortlet(PhaseListener pl) Adds a phase listener that is associated with the invoking
portlet instance. | public static String | getApplicationMessage(String key) Get the application message with the given key for the active locale. | public static Lifecycle | lifecycle() Return the Lifecycle . | public void | removePhaseListenerForPortlet(PhaseListener pl) Removes a listener associated with the invoking portlet instance. | public static ResourceBundle | resourceBundle(String baseName, Locale locale) Return a resource bundle for the given base and the given locale. | public static String | stringResource(String baseName, Locale locale, String key) Return the resource from the given resource bundle with the given key
using the given locale. | public static String | stringResource(String baseName, String key) Return the resource from the given resource bundle with the given key
using the active locale. |
LIFECYCLE | final public static String LIFECYCLE(Code) | | Attribute name for accessing lifecycle as request attribue.
|
activeLocale | public static Locale activeLocale()(Code) | | Return the active locale.
the active locale |
addMessage | public static void addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args)(Code) | | Add a message to the current faces context.
Parameters: severity - the message severity Parameters: baseName - the base name of the resource bundle with messages Parameters: key - the key of the message Parameters: args - arguments for message formatting |
addMessage | public static void addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args, String detail)(Code) | | Add a message to the current faces context.
Parameters: severity - the message severity Parameters: baseName - the base name of the resource bundle with messages Parameters: key - the key of the message Parameters: args - arguments for message formatting Parameters: detail - detailed information. This string is not localized. |
addMessage | public static void addMessage(FacesMessage.Severity severity, Locale locale, String baseName, String key, Object[] args, Throwable thrown)(Code) | | Add a message to the current faces context.
Parameters: severity - the message severity Parameters: the - locale to use Parameters: baseName - the base name of the resource bundle with messages Parameters: key - the key of the message Parameters: args - arguments for message formatting Parameters: thrown - a throwable providing the message details |
addMessage | public static void addMessage(FacesMessage.Severity severity, String baseName, String key, Object[] args, Throwable thrown)(Code) | | Add a message to the current faces context.
Parameters: severity - the message severity Parameters: baseName - the base name of the resource bundle with messages Parameters: key - the key of the message Parameters: args - arguments for message formatting Parameters: thrown - a throwable providing the message details |
addPhaseListenerForPortlet | public static void addPhaseListenerForPortlet(PhaseListener pl)(Code) | | Adds a phase listener that is associated with the invoking
portlet instance. Normally, listeners are associated with a lifecycle
with one instance for the complete application. If the application
consists of several JSF based portlets, listeners are therefore invoked
every time one of the portlets goes through the lifecycle.
In contrary, listeners registered with the method provided here are
only invoked when the registering portlet goes though its lifecycle.
In addition, the listeners are maintained using weak references.
Omitting the explicit remove therefore does not prevent the listeners
from being garbage collected.
Parameters: pl - the phase listener |
getApplicationMessage | public static String getApplicationMessage(String key)(Code) | | Get the application message with the given key for the active locale.
the message or null if not found |
lifecycle | public static Lifecycle lifecycle()(Code) | | Return the Lifecycle .
the result |
resourceBundle | public static ResourceBundle resourceBundle(String baseName, Locale locale)(Code) | | Return a resource bundle for the given base and the given locale.
Parameters: baseName - the base name of the resource bundle Parameters: locale - the locale the resource bundle See Also: JSFUtil.activeLocale |
stringResource | public static String stringResource(String baseName, Locale locale, String key)(Code) | | Return the resource from the given resource bundle with the given key
using the given locale.
Parameters: baseName - the base name of the resource bundle Parameters: locale - the locale Parameters: key - the key of the resource the resource See Also: JSFUtil.resourceBundle |
stringResource | public static String stringResource(String baseName, String key)(Code) | | Return the resource from the given resource bundle with the given key
using the active locale.
Parameters: baseName - the base name of the resource bundle Parameters: key - the key of the resource the resource See Also: JSFUtil.resourceBundle |
|
|