[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: Help with strange JSF <h:messages> behavior

NM-156 do-not-reply at jboss.com
Fri Mar 7 11:56:22 EST 2008


A couple of things were causing the problem. I realized that the weird prefix seems to be caused by having my variable markers enclosed by single quotes '{0}' instead of double quotes "{0}". The second thing is that I needed to have the message-bundle entry in the faces config. Finally, I had to override the default validator message keys/values in my message file. So my faces.config now looks like:



  | 
  |  <application>
  |   <message-bundle>mypackagename.application</message-bundle>
  |  </application>
  | 
  |   <application>
  |   <resource-bundle>
  |    <base-name>mypackagename.application</base-name>
  |    <var>msgs</var>
  |   </resource-bundle>
  |  </application>
  | 
  | 

And the message file looks like:


  | 
  | javax.faces.component.UIInput.CONVERSION=Invalid entry, not the correct data type
  | javax.faces.component.UIInput.REQUIRED=Value is required 
  | javax.faces.component.UISelectOne.INVALID=Value is not a valid option 
  | javax.faces.component.UISelectMany.INVALID=Value(s) are not a valid selection 
  | javax.faces.validator.NOT_IN_RANGE=Specified attribute is not between the expected values of "{0}" and "{1}" 
  | javax.faces.validator.DoubleRangeValidator.MAXIMUM=Value is greater than allowable maximum of "{0}"
  | javax.faces.validator.DoubleRangeValidator.MINIMUM=Value is less than allowable minimum of "{0}" 
  | javax.faces.validator.DoubleRangeValidator.TYPE=Value is not of the correct type 
  | javax.faces.validator.LengthValidator.MAXIMUM=Value is greater than allowable maximum of "{0}" 
  | javax.faces.validator.LengthValidator.MINIMUM=Value is less than allowable minimum of "{0}"
  | javax.faces.validator.LongRangeValidator.MAXIMUM=Value is greater than allowable maximum of "{0}" 
  | javax.faces.validator.LongRangeValidator.MINIMUM=Value is less than allowable minimum of "{0}" 
  | javax.faces.validator.LongRangeValidator.TYPE=Value is not of the correct type
  | formField1Label=Form Field 1:
  | formField2Label=Form Field 2:
  | formField3Label=Form Field 3:
  | formField4Label=Form Field 4:
  | 
  | 

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

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



More information about the jboss-user mailing list