On Monday, Feb 10, 2003, at 13:15 US/Eastern, John C Cartwright wrote:

Hello All,

I'm working through Chuck Cavaness' "Programming Jakarta Struts" book (and enjoying it, by the way!). I ran across the statement in reference to form-properties and DynaActionForms "...you should try to use only String properties, even with a DynaActionForm." The examples in the book sometimes seem to often violate this guideline, but my question is how else would one better convey a DataTransferObject class to a view's JSP page? Is it better to store it a Request Attribute?
Yeah the Dyna form stuff in the book threw me off too. Though I am enjoying the book I think Dyna and Validation are poorly covered (so are Tiles). After much digging, I decided to not really use DynaActionForms unless I wanted to let the user (client that is) edit the forms to add more fields. Usually it's not the case for me. The second reason why I decided not to use them as much is because when it comes to validation it's either all or nothing, so either all the fields are validated in the form or none. If you use ActionForms then you can have one ActionForm (FooForm) represent all the 'fields' in your form, and then you can pick and choose which fields you validate from one form to the next by adding a new validation definition.

On the String properties comment Chuck was mentioning, was because he said somewhere around the same quote you gave that if you wanted to use int or boolean it would complicate things since you'd have to use Integer and Boolean in the forms. I don't see an issue with doing that personally. So I'm not entirely sure why Chuck mentioned it... it threw me off more than helped in this case, and like you mentioned this particular guideline is often violated in the code.

Third piece is, read on to the next chapter and look at views. You would pass a View objet to the jsp page.

R

--
Robert S. Sfeir
Senior Java Engineer
National Institutes of Health
Center for Information Technology
Department of Enterprise Custom Applications
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to