• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Validation Solutions/Frameworks

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am curious for those of you who use home grown mini web frameworks instead of Struts, JSF, WW, etc, how do you handle your server side validation? Did you write your own solution for this? Are you just doing lots of If/else, switch/case in your code and then forwarding back to the JSP with error variables in the request?
 
Marshal
Posts: 67299
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mini-framework handles validation on two-levels:

1) The data marshalling mechanism (similar to a struts form) can perform straight data validation as appropriate (blank values, range checks and so on).

2) The execution modules can perform more context-sensitive checks.

In either case, failures cause a contruct to be returned to the view with enough information to report the errors (on a field-by-field basis if appropriate), and even highlight the form fields that were in error.

That's not the end of course. I also always perform business-layer validation on anything coming in from the controller layer.
[ March 21, 2005: Message edited by: Bear Bibeault ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, are you using any of the common-validation or did you write all your own stuff?
 
Bear Bibeault
Marshal
Posts: 67299
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All mine.

I'm not one of those "NIH guys" -- but I don't like to adopt something with losts of bells and whistles that I don't need.
[ March 21, 2005: Message edited by: Bear Bibeault ]
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!