Try adding 'name' attribute to the <html:text> tag....

   <html:text name="EmailForm" property="emailAddress" size="35"/>

The <html:form> tag will expose (or create a new) the ActionForm associated
with the mapping with a value of 'org.apache.struts.taglib.html.BEAN'. This
is the default 'name' for <html> tags if you don't specify one (which you
arnt). The action mapping on your form is "/enquiry/email.do" - not the
"/enquiry/showEmail" that you are showing us in your struts-config.

My bet is the mapping for "/enquiry/email.do" is still in your
struts-config.xml associated with a different form - so the <html:form> tag
is creating a new 'empty' form, with no email address and thats what your
<html:text> tag is picking up - not your new form.

Niall

----- Original Message ----- 
From: "RALPH ROPER" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 8:59 AM
Subject: DynaValidatorForm loses property value


> hi,
>
> I have changed a DynaActionForm to a DynaValidatorForm. The DynaActionForm
> email property (the only property on the form) was being displayed in a
new
> popup window. Since I changed to a DynaValidator form it shows the value
as
> blank. I have the Javascript validation working OK.
>
> The flow of events is as follows
> 1. User clicks on Request Email button on main window
> 2. ShowEmailAction is called that populates emailAddress property. (I have
> confirmed value is put into form).
> 3. Pops up new window and shows show_email.jsp. The emailAddress property
is
> blank.
>
> struts-config.xml
> <form-bean name="EmailForm"
> type="org.apache.struts.validator.DynaValidatorForm">
> <form-property name="emailAddress" type="java.lang.String" />
> </form-bean>
>
> <action path="/enquiry/showEmail"
> type="com.cuscal.mmdd.action.cuenquiry.ShowEmailAction" name="EmailForm"
> scope="session" input="/enquiry/showEmail.do" validate="false">
> <forward name="success"
> path="com/cuscal/mmdd/jsp/cu_enquiry/show_email.jsp"/>
> </action>
>
> ShowEmailAction
> public class ShowEmailAction extends MMDDirectBaseAction {
>
> public ActionForward execute(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws Exception {
>
> // logger.debug("Entered ShowEmailAction method");
> System.out.println("Entered ShowEmailAction method");
>
> UserView user = getUserContainer(request).getUserView();
> String email = user.getEmail();
> DynaValidatorForm emailForm = (DynaValidatorForm) form;
> // DynaActionForm emailForm = (DynaActionForm) form;
>
> emailForm.set("emailAddress", email);
> System.out.println("@@@email=" +
> emailForm.get("emailAddress")); // This bit works
> return mapping.findForward("success");
> }
>
> }
>
> show_email.jsp
>
> < ...... tags, validator javascript, etc ....... >
> <html:html>
> <HEAD>
> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> <META name="GENERATOR" content="IBM WebSphere Studio">
> <META http-equiv="Content-Style-Type" content="text/css">
>
> <link href=<html:rewrite
> href='/MMDDirectWeb/com/cuscal/mmdd/jsp/cu_enquiry/styles/styles00.css' />
> rel="stylesheet" type="text/css" />
> <TITLE>email.jsp</TITLE>
> </HEAD>
> <BODY>
> <P><strong>Verify Email Address</strong></P>
>
> <html:javascript formName="EmailForm" />
>
> <p>Please check/correct/add the email address below where the member's
list
> will be sent</p>
> <html:form action="/enquiry/email.do" onsubmit="return
> validateEmailForm(this);">
> <!-- <bean:define name="EmailForm" property="emailAddress"
> id="ea" type="java.lang.String" /> -->
> <html:text property="emailAddress" size="35"/><br/>
> <div align="right"><p></p>
> <a href="#" class="button1"
> onClick="window.close();">Cancel</a>
> <!-- <html:link href="../enquiry/email.do"
> styleClass="button1">Submit link</html:link>  -->
> <!-- <html:link action="/enquiry/email.do"
> styleClass="button1">Submit</html:link> -->
> <html:submit
> styleClass="button">Submit</html:submit>
> </div>
> </html:form>
> </BODY>
> </html:html>
>
> So close yet so far. Thanks for any assistance.
>
> regards,
>
> Ralph Roper
> Business Technology Services (BTS)
> Credit Union Services
>
>
> ________________________________________________________
> NOTICE
> The information in this email and or any of the attachments may contain;
> a. Confidential information of Credit Union Services Corporation
(Australia) Limited (CUSCAL) or third parties; and or
> b. Legally privileged information of CUSCAL or third parties; and or
> c. Copyright material of CUSCAL or third parties.
> If you are not an authorised recipient of this email, please contact
CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and
delete the email from your system.
> We do not accept any liability in connection with computer virus, data
corruption, interruption or any damage generally as a result of transmission
of this email.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to