Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can i assign an error message for validation annotation from a .properties file

 
Mohammad Noor Najdawi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

i want to ask how we can assign an error message for validation annotation from a .properties file.

ex:
import javax.validation.constraints.Size;

@Size(Min=4, message=" how assign it from .properties file")
String projectName;

/////////////////////////////////

assume my property file is myFile.props and want to get the following message from it:
PROJECT_NAME_ERROR_MSG = "Project name must be more than 3 characters "
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What validation framework are you using?
 
Mohammad Noor Najdawi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using hibernate validator + JSR 303
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic