Since I want to use the Validator outside of Struts (other guys at the office are doing Struts), I tried "Using the Validator Outside of Struts" (page 279 in my edition). It all works great, but as soon as a validation goes wrong, the message resource can't be found. I get
<blockquote>
...
Caused by: java.lang.NullPointerException
at org.apache.struts.validator.Resources.getMessageResources(Resources.java:150)
at org.apache.struts.validator.Resources.getActionError(Resources.java:222)
at org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:130)
... 26 more
</blockquote>
The guys on the Commons Validator mailing list told me that I should write all my own stuff, which is true from their point of view. But since Struts offers so many good validators, I think it would be a lost opportunity not to use them.
So, in a nutshell: When I use Struts Validators outside of Struts, how do I specify the message resources?
Can anybody help me out? Chuck? :-)
|