Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Validation Solutions/Frameworks  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
Chrome IntelliJ IDE Mac OS X
  • 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
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!