use of jakarta.faces.application.FacesMessage in project rubia-forums by flashboss.
the class SplitTopic method setInfoBundleMessage.
private void setInfoBundleMessage(String bundleKey) {
String message = getBundleMessage("ResourceJSF", bundleKey);
getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_INFO, message, "moderate"));
}
use of jakarta.faces.application.FacesMessage in project rubia-forums by flashboss.
the class JSFUtil method setErrorMessage.
/**
* @param id the id of the error message to create
* @param msg the text of the error message to create
*/
public static void setErrorMessage(String id, String msg) {
FacesMessage message = new // severity
FacesMessage(// severity
SEVERITY_ERROR, // summary
msg, // detail
msg);
getCurrentInstance().addMessage(id, message);
}
use of jakarta.faces.application.FacesMessage in project rubia-forums by flashboss.
the class JSFUtil method getMessage.
/**
* @param id the id of the message to find
*
* @return the text of the message
*/
public static String getMessage(String id) {
String msg = null;
Iterator<FacesMessage> msgs = getCurrentInstance().getMessages(id);
if (msgs != null) {
if (msgs.hasNext()) {
FacesMessage message = msgs.next();
msg = message.getDetail();
}
}
return msg;
}
use of jakarta.faces.application.FacesMessage in project rubia-forums by flashboss.
the class JSFUtil method handleException.
/**
* @author sshah
*
* @param e the exception to handle
*
* @return the navigation state of the application
*/
public static String handleException(Exception e) {
String genericNavState = ERROR;
String msg = e.toString();
FacesMessage message = new // severity
FacesMessage(// severity
SEVERITY_ERROR, // summary
msg, // detail
msg);
getCurrentInstance().addMessage(ERROR, message);
return genericNavState;
}
use of jakarta.faces.application.FacesMessage in project rubia-forums by flashboss.
the class ModeratorAction method setWarnBundleMessage.
private void setWarnBundleMessage(String bundleKey) {
String message = getBundleMessage("ResourceJSF", bundleKey);
getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_WARN, message, "moderate"));
}
Aggregations