1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| 40 static void addErrorMessage(FacesContext facesContext,
41 UIComponent component,
42 String messageId)
43 {
44 facesContext.addMessage(component.getClientId(facesContext),
45 getMessage(facesContext,
46 facesContext.getViewRoot().getLocale(),
47 FacesMessage.SEVERITY_ERROR,
48 messageId,
49 null));
50 }
51
64 static FacesMessage getMessage(FacesContext facesContext,
65 Locale locale,
66 FacesMessage.Severity severity,
67 String messageId,
68 Object args[])
69 {
70 ResourceBundle appBundle;
71 ResourceBundle defBundle;
72 String summary;
73 String detail;
74
75 appBundle = getApplicationBundle(facesContext, locale);
76 summary = getBundleString(appBundle, messageId);
//.......
114 if (args != null && args.length > 0)
115 {
116 MessageFormat format;
117
118 if (summary != null)
119 {
120 format = new MessageFormat JavaDoc(summary, locale);
121 summary = format.format(args);
122 }
//.....
130
131 return new FacesMessage(severity, summary, detail);
132 } |
Partager