Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda