Erik, Thanks for the thoughtful reply. My comments are inline below.
-----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 7:54 PM To: [EMAIL PROTECTED] Subject: Re: [Xdoclet-user] Struts, Validator, non-supported Types On Thursday, March 20, 2003, at 05:43 PM, Chris Butler wrote: >> to the heart of the issue. Currently there is no problem with the >> standard String validation, but nothing will be generated for the >> second >> validation tag... setCityStateZip() because it is not a supported >> type. >> I believe this is a result from line 298 in >> StrutsValidatorTagsHandler.java (method = getFields()). >> >> if (supportedTypes.contains(type)) { >That check is only done after it recursively descends the beans. So it >descend into CityStateZip. My mistake on that one... Unfortunately it doesn't actually help me... see below. > You're putting action mappings on form beans? *ick* (sorry, a pet > peeve of mine, but we'll gloss over this one :)... actually - I wasn't I accidentally took that from my action... :-/ I really wanted to show the struts form tag only. > But look at the example I provided. The way to do it (currently) is to > tag the city, state, and zip setters in CityStateZip instead, not the > parent (except with just the marker @struts.validator so it knows to > descend into it). Its not idea, I know. But nested form beans are > rarely used (in my experience) and we only use one in our entire system > of 50+ forms. All our form beans are wrappers for beans generated by XDoclet as ValueObjects from CMP2 EJBs. Thus I would need to first change the EJB template to allow for putting a tag in an EJB which would create *another* tag in our ValueObject, which would be later parsed by strutsvalidationxml... On top of that, since we've used maven to delineate our EJB code from our webapp code (separate projects), I couldn't access those beans java files for further "regeneration" by strutsvalidationxml. All that EJB code (value objects and the like) are jarred up and are just a dependency for the webapp. And... all our forms used struts nested tags and nested beans. We have a few fairly complex attribute trees that would be a pain to reconstruct from a flattened form. Struts nested tags are *fantastic* for handling this behavior. Anyway... so it seems the biggest impediment to handling the auto-validation check is the lack of ability to be able to add a struts validator tag in non-form beans (as a result of project separation and XDoclet EJB generation). However, I'm not sure why I would ever want to put validator tags in beans that might not be related to the web app at all. Also, introducing a dependency between the EJB code and the webapp code is very undesirable. Has anyone else who uses XDoclet generated ValueObjects in forms run into this issue? It most likely would come up with folks who are using nested tags heavily in managing forms. Chris ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
