Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring validation

 
Jose Tlaseca
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody:

I have a java web application project with Spring framework in netbeans and I'm trying to use Spring validation.

What my application does is raise a support ticket.

I have read several tutorials and I've gotten the form is not sent until the fields are filled. The problem is that I can not get to show error messages which I defined in the class "Validator".

That is, if required fields are not filled the form is not sent, but the error message does not appear anywhere.

Can someone tell me what I'm doing wrong?


These are my codes:




SupportTicket Class:










SupportTicketValidator class:








SupportTicketController Class:








Dispatcher-Servlet.xml:







InputView.jsp:







As I mentioned, the validation works (I think) because the form is not submited until i fill the required fields, but the error messages are not shown with that < form:errors > tags.


Can you give me an advice to solve my problem?
 
abani patra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you are right the problem is in your jsp please refer any example from http://www.vaannila.com/spring/spring-form-validation-1.html and change accordingly and test.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic