[jboss-user] [JBoss Seam] - Problem using parameters for custom hibernate messages

andreigh.ts do-not-reply at jboss.com
Wed Sep 5 05:57:40 EDT 2007


I have an entoty bean with a property that has a max 255 length. I want to customize the default hibernate  validator.length message, in order to display only the max value, not the min value (default validator.length is defined as 'length must be between {min} and {max}').

So I have this code:


  | @Length(max=255, message="#{messages['validator.length.maxonly']}")
  | @Column(name = "Description", unique = false, nullable = false, insertable = true, updatable = true)
  | public String getDescription() {
  | 	return this.description;
  | }
  | 

in messages_en.properties, the key is defined like this

validator.length.maxonly=length must be less or equal than {max}

The problem is that {max} is not replaced at runtime with 255.

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

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



More information about the jboss-user mailing list