The struts-example uses it for Logon.

struts-config.xml
-----------------------------------
...
...
    <form-bean      name="logonForm"
                    type="org.apache.struts.action.DynaActionForm">
      <form-property name="username" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>
    </form-bean>
...
...
    <!-- Process a user logon -->
    <action    path="/logon"
               type="org.apache.struts.webapp.example.LogonAction"
               name="logonForm"
              scope="request"
              input="/logon.jsp">
      <exception
                key="expired.password"

type="org.apache.struts.webapp.example.ExpiredPasswordException"
               path="/changePassword.jsp"/>
    </action>
...
...




logon.jsp
--------------------------------------
<html:form action="/logon" focus="username">
<table border="0" width="100%">

  <tr>
    <th align="right">
      <bean:message key="prompt.username"/>
    </th>
    <td align="left">
      <html:text property="username" size="16" maxlength="16"/>
    </td>
  </tr>

  <tr>
    <th align="right">
      <bean:message key="prompt.password"/>
    </th>
    <td align="left">
      <html:password property="password" size="16" maxlength="16"
                    redisplay="false"/>
    </td>
  </tr>

  <tr>
    <td align="right">
      <html:submit property="submit" value="Submit"/>
    </td>
    <td align="left">
      <html:reset/>
    </td>
  </tr>

</table>

</html:form>


LogonAction.java
--------------------------------------------
...
...
        // Validate the request parameters specified by the user
        ActionErrors errors = new ActionErrors();
        String username = (String)
            PropertyUtils.getSimpleProperty(form, "username");
        String password = (String)
            PropertyUtils.getSimpleProperty(form, "password");
...
...



JM





> -----Original Message-----
> From: Parmar, Dipakkumar [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 29, 2002 11:38 PM
> To: Struts Users Mailing List
> Subject: DynaActionForm example
>
>
> can anyone point me the DynaActionForm example?
> i could not able to find it.
>
> Tx in advance.
> Deepak
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to