Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda