本文整理汇总了Java中javax.faces.application.FacesMessage.SEVERITY_FATAL属性的典型用法代码示例。如果您正苦于以下问题:Java FacesMessage.SEVERITY_FATAL属性的具体用法?Java FacesMessage.SEVERITY_FATAL怎么用?Java FacesMessage.SEVERITY_FATAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.faces.application.FacesMessage
的用法示例。
在下文中一共展示了FacesMessage.SEVERITY_FATAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sGetMaxSeverity
public static FacesMessage.Severity sGetMaxSeverity(UIXRenderingContext context)
{
// This doesn't seem to work if there is a global message
// return context.getFacesContext().getMaximumSeverity();
FacesMessage.Severity max = FacesMessage.SEVERITY_INFO;
Iterator<MessageWrapper> itr = sGetIterator(context, true);
while (itr.hasNext())
{
FacesMessage nxt = itr.next();
FacesMessage.Severity sev = nxt.getSeverity();
if (sev.compareTo(max) > 0)
{
max = sev;
if (FacesMessage.SEVERITY_FATAL.compareTo(max) == 0)
return FacesMessage.SEVERITY_FATAL;
}
}
return max;
}
示例2: MessageTest
public MessageTest(String severity, String summary, String detail,
String clientId)
{
FacesMessage.Severity sev = FacesMessage.SEVERITY_INFO;
if (severity != null)
{
if ("ERROR".equals(severity))
sev = FacesMessage.SEVERITY_ERROR;
else if ("WARN".equals(severity) || "WARNING".equals(severity))
sev = FacesMessage.SEVERITY_WARN;
else if ("FATAL".equals(severity))
sev = FacesMessage.SEVERITY_FATAL;
}
_messages.put(clientId, new FacesMessage(sev, summary, detail));
}
示例3: createGlobalMessage
public String createGlobalMessage()
{
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_FATAL,
"Fatal Msg.", "Programatically generated at " + new Date());
context.addMessage(null, msg);
return null;
}
示例4: createGlobalMessage
public String createGlobalMessage() {
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_FATAL,
"Fatal Msg.", "Programatically generated at " + new Date());
context.addMessage(null, msg);
return null;
}