struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: Validator Framework: Can not evaluate regular expression
Date Wed, 30 Jul 2003 21:25:29 GMT
Password fields are only run against the "required" validation in the
client side javascript for security purposes.  Password fields are
validated with all rules on the server side though.

David

--- Dirk Behrendt <schnoerk@web.de> wrote:
> Hi!
>  
> No, I do not have an extra '<' in my code. The regular expression is not
> evaluated.
>  
> Example:
> When I use <var-value>^[a]$</var-value> the user only should input "a". 
> But in my case you can input anything you want.
>  
> There are some ideas?
>  
> Dirk
>  
>  
>  
> If your code is a direct cut-n-paste, you've got an extra '>' in your
> first regular expression?
>  
>       <var-value>>^[a-zA-Z0-9_.-]*$</var-value>
>  
> -jeff
>  
> On Wednesday, July 30, 2003, at 07:14  AM, Dirk Behrendt wrote:
>  
> > <var-value>>^[a-zA-Z0-9_.-]*$</var-value>
>  
>  
> Hello!
>  
> I want to check login and password fields.
>  
> If I submit with empty textfields, the errors are shown correct (....
> required). But my regular expression was ignored. (see code below).
>  
> What is necessary to check regular expressions?
>  
>  
>  
>  
> Dirk
>  
>  
> Struts-config.xml
> -----------------
>  
> form-bean name="loginForm"
>            type="sample.LoginForm"/>
>  
> <!-- User login -->
>     <action    path="/login"
>                type="sample.LoginAction"
>                name="loginForm"
>                scope="session"
>                validate="true"
>                input="/loginDone.jsp">
>     </action>
>  
>  
> validation.xml
> --------------
>  
> <form name="loginForm">
>          <field 
>            property="login"
>            depends="required,mask">
>            <msg name="mask" key="error.loginForm.character.maskmsg"/>
>            <arg0 key="label.login"/>           
>            <var>
>              <var-name>mask</var-name>
>              <var-value>>^[a-zA-Z0-9_.-]*$</var-value>
>            </var>               
>          </field>  
>          <field 
>            property="password"
>            depends="required,mask">
>           <msg name="mask" key="error.loginForm.character.maskmsg"/> 
>           <arg0 key="label.password"/>           
>            <var>
>              <var-name>mask</var-name>
>              <var-value>^[a-zA-Z0-9_.-]*$</var-value>
>            </var>               
>          </field>                  
>       </form> 
>  
>  
> In my JSP
> -----------
>  
> <logic:messagesPresent>
>    <bean:message key="errors.header"/>
>    <ul>
>    <html:messages id="error">
>       <li><bean:write name="error"/></li>
>    </html:messages>
>    </ul><hr>
> </logic:messagesPresent>           
>  
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
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