[jboss-user] [JBoss Seam] - Re: Questions on resourceBundle

hasc do-not-reply at jboss.com
Mon Apr 16 12:01:08 EDT 2007


so far i' ve tried the following:

in faces-config.xml:
<application>
  |    <locale-config>
  |       <default-locale>de</default-locale>
  |       <supported-locale>de</supported-locale>
  |       <supported-locale>en</supported-locale>
  |       <supported-locale>fr</supported-locale>
  |    </locale-config>
  |    <message-bundle>messages</message-bundle>
  | </application>

in the *.ear i have the files messages.properties, messages_en.properties, messages_fr.properties, messages_de.properties in the directory WEB-INF/classes

in the getAsObject() Method of the CustomConverter i throw an Exception:
...
  |    FacesMessage message = MessageFactory.getMessage(FacesMessage.SEVERITY_ERROR, "AreaConverterPositiveNumber");
  |    throw new ConverterException(message);

and the MessageFactory class is the following:

public class MessageFactory {
  | 	
  |    public static FacesMessage getMessage(FacesMessage.Severity severity, String id) {
  |       String summary = "???" + id + "???";
  |       String detail = null;
  | 		
  |       FacesContext context = FacesContext.getCurrentInstance();
  |       String name = context.getApplication().getMessageBundle();
  |       Locale locale = context.getViewRoot().getLocale();
  |       ResourceBundle bundle = ResourceBundle.getBundle(name, locale);
  |       summary = bundle.getString(id);
  |       detail = bundle.getString(id + "Detail");
  | 		
  |       return new FacesMessage(severity, summary, detail);
  | 	}
  | }

i get the following error message:

2007-04-16 17:53:48,828 ERROR [STDERR] 16.04.2007 17:53:48 com.sun.faces.lifecycle.ProcessValidationsPhase execute
  | WARNUNG: Can't find bundle for base name messages, locale de
  | java.util.MissingResourceException: Can't find bundle for base name messages, locale de
  | 	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)
  | 	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
  | 	at java.util.ResourceBundle.getBundle(ResourceBundle.java:576)
  | 	at gmp.webapp.converter.MessageFactory.getMessage(MessageFactory.java:18)
  | 	at gmp.webapp.converter.AreaConverter.getAsObject(AreaConverter.java:90)
  | 	at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:188)
  | 	at javax.faces.component.UIInput.getConvertedValue(UIInput.java:943)

Would be great if someone could help me with that.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037623#4037623

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037623



More information about the jboss-user mailing list