struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tan Khay Ong" <khay...@ewarna.com>
Subject RE: Problem with DynaActionForms
Date Fri, 11 Jul 2003 01:17:18 GMT
You are using the Dynamic form. It doesn't create java class for
loginForm.
All values are stored in the Map of DynaValidatorFrom. You can retrieve
form value as below.

DynaValidatorForm dyform = (DynaValidator) form;
String userName = (String) dyform.get("userName");
String password = (String) dyform.get("password");

-----Original Message-----
From: Richard Stack [mailto:richardstack@rogers.com] 
Sent: Friday, July 11, 2003 9:08 AM
To: struts-user@jakarta.apache.org
Subject: Problem with DynaActionForms


I'm implementing DynaActionform for the first time. I'm defining them in

struts-config.xml.
<form-bean
     name="loginForm"
     dynamic="true"
     type="org.apache.struts.validator.DynaValidatorForm">
     <form-property name="userName" type="java.lang.String"/>
     <form-property name="password" type="java.lang.String"/>
  </form-bean>

<action
    path="/signin"
    type="com.acme.LoginAction"
    scope="request"
    name="loginForm"
    validate="true"
    input="/start/signin.jsp">
    <forward name="Success" path="/action/mainPage.jsp"/>
    <forward name="Failure" path="/start/signin.jsp" redirect="true"/>
  </action>

The problem seems to be when I try to reference the form in the Action 
class's execute method. I get an error message in LoginAction 
"Unresolved symbol LoginForm".

public ActionForward execute(){
	String userName = ((LoginForm)form).getUserName();
     	String password = ((LoginForm)form).getPassword();
}

Anyone have an idea where I went wrong?

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message