Hi,

I have a http://localhost:8080/login.do action and I want to do validation for the 
form when user submit their username & password. 

here is my setting in validation.xml:

        <form name="loginForm">
            <field property="username" depends="required">
                <arg0 key="its.login.username"/>
            </field>
            <field property="password" depends="required,mask">
                <arg0 key="its.login.password"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[0-9a-zA-Z]*$</var-value>
                </var>
            </field>
        </form>

The validation works fine however, when I just type the http://localhost:8080/login.do 
in my browser (no submit), the validation error will show up at once.
I understand that it's just like I submit a form to login.do action without any 
parameter.
My question is, do struts provide any simple method to avoid this and just show no 
error message? Thanks a lot!!!

Justy

Reply via email to