Struts Validator and java.math.BigDecimal.
I've been working feverishly against a Friday deadline, having lots of fun, and learning more than I ever wanted to know about Struts, Hibernate, XDoclet, etc. I'm the closest thing that we have on the project to a Struts expert, so I've had to come up to speed fast on Struts Tiles, Struts Validator, and XDoclet's Struts support. So far, so good, but now I've hit a snag. I've run up against what appears to be a serious Struts Validator limitation: no support for java.math.BigDecimal
.
I tried using the double validator, but when I apply the XDoclet tag for the double validator to a field that is a BigDecimal, XDoclet does not generate an entry for the field in validation.xml
. Maybe, if I can fix this I can get away with using the double validator. Hmmm...
To resolve this problem the right way, it seems that I'll need to write my own validator. No problem right? I think this involves four steps:
- Provide a class with a
validateBigDecimal()
method for server-side validation. - Write the JavaScript for client-side validation.
- Write the XML for my validator and put it in
validator-rules.xml
. - Fetch XDoclet from CVS and hack the Struts Validator support to handle my new validator.
That last step is a doozy. There's got to be an easier way, but googling turns up nothing. I guess I have figured out how I will spend my evening.
Posted by Erik Hatcher on August 12, 2003 at 07:39 AM EDT #
Posted by Erik Hatcher on August 12, 2003 at 07:42 AM EDT #
Posted by Unknown on September 03, 2003 at 07:10 AM EDT #