use of javax.faces.application.FacesMessage in project microservices by pwillhan.
the class Base64Converter method getString.
public String getString(Object value) {
if (!(value instanceof Serializable))
throw new ConverterException(new FacesMessage("Must be java.io.Serializable: " + value));
try (ByteArrayOutputStream bo = new ByteArrayOutputStream();
ObjectOutputStream so = new ObjectOutputStream(MimeUtility.encode(bo, "base64"))) {
so.writeObject(value);
so.flush();
return bo.toString();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
use of javax.faces.application.FacesMessage in project rubia-forums by flashboss.
the class ModeratorAction method setInfoBundleMessage.
private void setInfoBundleMessage(String bundleKey) {
String message = getBundleMessage("ResourceJSF", bundleKey);
getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_INFO, message, "moderate"));
}
use of javax.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"));
}
use of javax.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 javax.faces.application.FacesMessage in project rubia-forums by flashboss.
the class PollValidator method throwValidationException.
private void throwValidationException(String exceptionMsg) throws ValidatorException {
FacesMessage message = new FacesMessage();
message.setDetail(getBundleMessage(BUNDLE_NAME, exceptionMsg));
message.setSummary(getBundleMessage(BUNDLE_NAME, exceptionMsg));
message.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(message);
}
Aggregations