This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation being ignored

 
Arne Willemyns
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm having some trouble getting my struts 2 validation to work properly let alone getting fielderror tags displayed.

The action mapping:



The action class itself:



jsp snippet:



An interesting part of the log file (full log is attached):



He runs the validators but still executes the query part of the execute method.
He doesn't return to the input page because afterwards the url is like this: .../search/searchByPrice.action?minPrice=&maxPrice=&resultCount=10

Any help would be appreciated!
Arne
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first guess would be that it's because you're using primitive doubles. The default value of a primitive double is 0, and you're using the "required" validator, so there's no reason for the framework to think they don't exist.

If you want to use the "required" validator I think you'd need to use the object version, Double.
 
Arne Willemyns
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep that worked. I'm having a "I-can't-believe-I-couldn't-come-up-with-that-myself" moment.
Anyway, thanks a lot!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we had a nickel for every time we had moments like that we'd be rich! ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic