I've just started testing out the struts form generator.  I have a general
question that probably has more to do with struts in general, but depending
on answers has to do with how xdoclet generates the forms.

I've built some webapp code by hand using jsp's and regular javabeans.  In
the beans, I represented fields with their actual types (integer types with
'int' or 'Integer', floats with 'float' or 'Float').  When the form is
submitted, it tries to convert the form parameters to these types (using
setParameter="*").  If it fails, it bombs.  For example, if I type '12r5'
into one of the int fields, I get a NumberFormatException.  If there were a
way to just not set the field if it were incorrect instead of bombing, that
would be ok, but it would still not be ideal.  You really need to keep the
incorrect input and put it back in the form after the request with an error
message.  To build this correctly, I'd have to take String parameters
instead of the actual types, attempt to convert them, and either fill a real
data object (with real types), or return and show an error.

To build a similar user experience in struts, I assume that form classes
should be built with String data elements, which, if valid, would then be
pushed to a more accurately typed data object.  Is this correct, or is there
some mechanism in struts that handles this under the hood (assuming no)?

(xdoclet part)
If no, is there a way to override what comes out of xdoclet when it produces
forms?  Some of the fields in my entity beans are fine, but some of them are
non-string types which would have major trouble with the bad input.

Thanks,
-Kevin


================================================================= 
This message contains confidential business information that is 
intended for use only by the individual or entity to whom it is 
addressed.  If you are not the intended recipient, you are hereby 
notified that any disclosure, interception, copying, distribution 
or the taking of any action in reliance on the contents of this 
email is prohibited.  If you received this email in error, please 
notify the sender by forwarding the message back to the sender, 
and then delete the original information from your system. 
================================================================= 




-------------------------------------------------------
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

Reply via email to