Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

I�m new with Spring

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I'm using Spring to manage some forms and, until now, when the user introduced an incorrect value for a field (i.e. an invalid user), I sended him to another jsp. Now I won't to send him to the same jsp whith a message saying "you were wrong..." or something like that. I put this code in my SimpleFormController:




I expected that would make this to work correctly, it only redirect to te jsp, but no errors apperars.
How would i make this??
Thanks a lot.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
create a validator annd inject that to you controller
like
<bean id="yourcontroller" class="YourController" >
<property name="validator" ref="yourValidatorRef" >
..............
</bean>
<bean id="youValidatorRef" class="YourValidatorClass" />

and call <form:errors path="*" />
here form tag is springs form tag.

for more information refer Spring Reference document, on how to create validators
 
Antonio Li��n
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, but i'm not talking about validation. I already have a validator that tests the values looking for empty or whitespaced values, I'm talking about to compare a value with one in the database, and if them are differents, then show the error.





Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic