Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
Size validation max value is {javax.validation.constraints.Size.message}

I have a field in the student class in the Spring MVC

@Size(min=5,max=30)
    private String studentHobby;

I have put the size validation for it.

and write the following code in the spring-servlet.xml file

 </bean>
<bean id="messageSource" class= "org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename"  value="/WEB-INF/studentmessages"/>
</bean>

studentmessages.properties files is:

Size.student1.studentHobby =pls enter a  value for {0} between {2} and {1} characters

I am getting the value of min field but not getting for max field

pls enter a value for studentHobby between 5 and {javax.validation.constraints.Size.message} characters

can someone let me know what could be the reason for not getting the max value?

Thanks

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Don't know how but when i changed the

studentmessages.properties files as:

Size.student1.studentHobby = pls enter a  value for {0} between {2} and {4} characters.

It gives me the right message as

pls enter a value for studentHobby between 5 and 30 characters.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!