• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

Calling Showform on Onsubmit of SimpleFormController

Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am currently experimenting on the Spring MVC by trying out some simple exercise.

I have this scenario in my mind, suppose I want to validate something using the onsubmit method of the simpleformcontroller.
In this case, I want to check if the commandclass value is correct and if there is something wrong, I want to display the form again
with form:errors.

Thru some experiment I was able to come up with below code. I call the showform on the onsubmit method. My question is, is this the right
way to do what I want. I am not sure if this is efficient or not.

By the way, here's my another question. Given below scenario, should it be much better If I transfer below code in the validator class?
I currently used my validator class in validating for empty space which I can do also with javascript.

I want to ask those experts in spring if its alright to put all of your business logic validation in the Validator class? I am currently reluctant to
add JDBC and DAO calls in my validator. I wanted to hear if those who have created full grown enterprise application in spring has been doing these.

Thanks and looking forward to your responses.
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for your code that helped me to answere some of my problem, keep up the good work bro..

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic