aspose file tools*
The moose likes JSP and the fly likes can i assign an error message for validation annotation from a .properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "can i assign an error message for validation annotation from a .properties file" Watch "can i assign an error message for validation annotation from a .properties file" New topic
Author

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

Mohammad Noor Najdawi
Greenhorn

Joined: Aug 02, 2010
Posts: 19
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

Joined: Jan 10, 2002
Posts: 61646
    
  67

What validation framework are you using?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mohammad Noor Najdawi
Greenhorn

Joined: Aug 02, 2010
Posts: 19
i am using hibernate validator + JSR 303
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i assign an error message for validation annotation from a .properties file