You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andy Pahne <ap...@big1.de> on 2003/05/17 22:36:15 UTC

DynaValidatorForm validating on first request

Hi,

When using a DynaValidatorForm (see below) for a simple login-form the
validation takes place before the form is displayed the first time. So the
user hits the "Login" link, the form get's displayed (with empty formfields)
and validation errors.

Of course I want some validation to take place after submission, but not
before submission. Am I missing some configuration options or so?


<!-- for-bean from struts-config.xml  -->
    <form-bean name="logonForm"
type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="username" type="java.lang.String" />
      <form-property name="password" type="java.lang.String" />
    </form-bean>


Here's the action:

    <action path="/logon"
    	    type="org.derdiedas.webapp.LogonAction"
    	    name="logonForm"
    	    scope="session"
    	    input="/logon.jsp"
    	    unknown="true"
    	    validate="true">
       <forward name="success" path="/management.jsp" />
    </action>


And how I invoke the action from the Welcome page:


<html:link forward="login">
  Login
</html:link>




Andy




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