Please help me in learning how to code when I am working with DynaValidatorForm. 1. in my struts-config.xml, I have:
2. My PostForm.java is like:
3. in my action class (see the code below) 3.1. do I cast the form to DynaActionForm? or I should cast the form to DynaValidatorForm? 3.2. Can I use the copyProperties() method of the BeanUtils to convert the form to a bean? BeanUtils.copyProperties( threadBean, postForm );
4. the action mapping in my struts-config.xml is like:
It seems like you are mixing your metaphors. Why are you redefining the property in both the Java class version of the ActionForm and the properties file. You either want to do one or the other. If you are using DynaActionForms or DynaValidatorForms you do not need a class that subclasses DynaValidatorForm.
I do not quite get the idea. Please help with the drafted code for the PostForm, which is of type="org.apache.struts.validator.DynaValidatorForm" 1. which class should be imported? 2. how do I code the reset( ... )?
Thank you.
Rick Hightower
Author
Ranch Hand
Joined: Feb 20, 2002
Posts: 350
posted
0
Do this:
(Notice form not dynamic) With this: <form-bean name="postForm" type="yourpackage.PostForm"/>
OR THIS:
BUT.... Not both
JiaPei Jen
Ranch Hand
Joined: Nov 19, 2000
Posts: 1309
posted
0
Allow me to ask three more questions: 1. If I want to reset some specific text fields when the JSP is re-displayed, do I code the PostForm.java like this (please confirm):
2. if I want to reset all the text fields when the JSP is re-displayed, do I code like this (please confirm):
3. What is the difference between
AND
Rick Hightower
Author
Ranch Hand
Joined: Feb 20, 2002
Posts: 350
posted
0
Hey.... I answered this in a lot of detail (same question from the same person) in detail on the Struts mailing list. I'll add a link to the archive as I hate doing....UBB
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How To Code When Work With DynaValidatorForm