public class JsfUtil extends Object
| Constructor and Description |
|---|
JsfUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addErrorMessage(Exception ex,
String defaultMsg) |
static void |
addErrorMessage(String msg)
uses null as clientId
|
static void |
addErrorMessage(String clientId,
String msg) |
static void |
addErrorMessages(List<String> messages) |
static void |
addSuccessMessage(String msg)
Uses successInfo as client id
|
static void |
addSuccessMessage(String clientId,
String msg) |
static String |
contextPath() |
static <T> T |
findInContext(Class<T> clazz)
Calls
findInContext(java.lang.String, java.lang.Class) with clazz.simpleName, first letter lowerCase |
static <T> T |
findInContext(String name,
Class<T> clazz) |
static <T> T |
findOrCreateInContext(String name,
Class<T> clazz) |
static String |
fullServletPath()
context path plus servlet path
|
static javax.faces.convert.Converter |
getConverter(Class clazz) |
static String |
getFromBundle(ResourceBundle bundle,
String key) |
static ResourceBundle |
getLocaleBundle(String bundle)
return a resource for the current locale (from faces context or default locale), or an empty bundle
|
static void |
handleException(Exception ex,
String prefix)
Calls
FacesContext.validationFailed(), #deepestCause(java.lang.Throwable)
and addErrorMessage(java.lang.String) with the prefix and the
localized message from the exception. |
static boolean |
isValidationFailed() |
static void |
logout() |
static void |
redirectToServletPath(String servletPath) |
public static void handleException(Exception ex, String prefix) throws Exception
FacesContext.validationFailed(), #deepestCause(java.lang.Throwable)
and addErrorMessage(java.lang.String) with the prefix and the
localized message from the exception. rethrows the exceptionex - prefix - Exceptionpublic static boolean isValidationFailed()
public static void addErrorMessage(String msg)
msg - public static void addSuccessMessage(String msg)
msg - public static <T> T findInContext(Class<T> clazz)
findInContext(java.lang.String, java.lang.Class) with clazz.simpleName, first letter lowerCaseT - clazz - public static javax.faces.convert.Converter getConverter(Class clazz)
public static String fullServletPath()
public static String contextPath()
public static void redirectToServletPath(String servletPath) throws IOException
IOExceptionpublic static void logout()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic static ResourceBundle getLocaleBundle(String bundle)
bundle - public static String getFromBundle(ResourceBundle bundle, String key)
Copyright © 2018 Fryske Akademy. All rights reserved.