aspose file tools*
The moose likes Struts and the fly likes Validation being ignored Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation being ignored" Watch "Validation being ignored" New topic
Author

Validation being ignored

Arne Willemyns
Greenhorn

Joined: Jan 29, 2009
Posts: 10
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 29, 2009
Posts: 10
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

Joined: Sep 29, 2008
Posts: 12617

If we had a nickel for every time we had moments like that we'd be rich! ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation being ignored
 
Similar Threads
Problem with error page example
How to get aroun LazyInitialization exceptions using Spring HibernateDaoSupport?
Formlogin/Apache/SSL
550 Invalid recipient Problem whilst I am sending Email using SMTP
can not deploy application!!!!