Solved

Validator question

Posted on 2006-11-20
31
1,832 Views
Last Modified: 2010-05-18
Hi,

on my website, when a user try to authenticate, I check if the field "password" was correctly entered :
when he enters a password length smaller then 6 cars, he get an error like
"need more then 6 cars"
then if he has a password of 6 or more, I checked for the carachters, see if there are no special cars in it.
if he entered special cars I display something like
"password invalid"
This was all possible for me without Struts.

Since I moved to Struts,
I try to implement the Validator framework.
But how can I do something basic like what I had without Struts.

In my validation.xml (need to be corrected) :

<form-validation>
      <global>
            <constant>
                  <constant-name>password_length</constant-name>
                  <constant-value>^(\.{6,})$</constant-value>
            </constant>
            <constant>
                  <constant-name>password_cars</constant-name>
                  <constant-value>^(w+)$</constant-value>
            </constant>
      </global>
      
      <formset>
            <form name="authenticationForm">
                  <field      property="password"
                                    depends="required,mask">
                                    <arg0 key="invalid.password_length"/>
                                    <var>
                                          <var-name> mask</var-name>
                                          <var-value>${password_length}</var-value>
                                    </var>
                  </field>
                  <field      property="password"
                                    depends="required,mask">
                                    <arg0 key="invalid.password_cars"/>
                                    <var>
                                          <var-name> mask</var-name>
                                          <var-value>${password_cars}</var-value>
                                    </var>
                  </field>
            </form>
      </formset>


Can someone help me ?
And I need to be sure to not display the cars message if length message is displayed.
0
Comment
Question by:matthew016
  • 17
  • 14
31 Comments
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
use maxlength rule for length validation . something like

<field property="field name" depends="integer,maxlength">
              <arg0 key="field mustbe an integer"/>  //key in applicationreources.properties file
              <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
              <var><var-name>maxlength</var-name><var-value>6</var-value></var>
 </field>


make sure you have

errors.integer={0} must be an integer.
errors.maxlength={0} can not be greater than {1} characters.

in applicationresources.properties file , other wise error wont be displayed.


Also, avoid duplicate entries , like you have repeated <field     property="password" .. twice.
just have it defined once and apply all the rules to that field, like this


 <field     property="password"
                depends="required,maxlength,mask">
                <arg0 key="password.required"/> //have a message for password required in applResources.properties file
                    <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
              <var><var-name>maxlength</var-name><var-value>6</var-value></var>
 <msg name="mask" key="invalidcharacters.Message"/>
<!-- have a message for invalid characters in password (in applResources.properties file) -->
   <var>
   <var-name>mask</var-name>
   <var-value>${password_cars}</var-value>
   </var>


 </field>

the above rules will take care of required, maxlength and invalid chars

that should help
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
I will try jaggernat, thank you
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Dear jaggernat,

your code compile with dtd 1_1_3
but not with the latest dtd 1_3_0
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Anyway I tried with 1_1_3 and I have this error :
org.xml.sax.SAXParseException: Element type "arg0" must be declared.
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
not sure why thats hapenning.
did you put  password.required  in applicationresources.properties file ?


try without mask first and see if it works
 
<field     property="password"
                depends="required,maxlength">
                <arg0 key="password.required"/> //have a message for password required in applResources.properties file
                    <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                    <var>
                    <var-name>maxlength</var-name>
                   <var-value>6</var-value>
                   </var>

 </field>

dont forget to build your project and restart the server.
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Dear jaggernat,

I made it more simple to test :

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE form-validation PUBLIC
     "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
     "http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">
<form-validation>
      <formset>
            <form name="loginForm">
                <field property="login" depends="required">
                    <arg key="required.login"/>
                </field>
            </form>
      </formset>
</form-validation>


I have the following result :
***************************************************
GRAVE: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
      at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:603)
      at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:533)
      at org.apache.commons.validator.Field.validateForRule(Field.java:766)
      at org.apache.commons.validator.Field.validate(Field.java:846)
      at org.apache.commons.validator.Form.validate(Form.java:290)
      at org.apache.commons.validator.Validator.validate(Validator.java:354)
      at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:113)
      at org.apache.struts.chain.commands.servlet.ValidateActionForm.validate(ValidateActionForm.java:53)
      at org.apache.struts.chain.commands.AbstractValidateActionForm.execute(AbstractValidateActionForm.java:100)
      at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
***************************************************


At least it tries to validate ...
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
problem with validation-rules.xml

you would have a file called validation-rules.xml in web-inf folder and in that xml file you would have the definition for "required" rule.

do you have the file?
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
<form-validation>
  <global>
    <validator name="required"
          classname="org.apache.struts.validator.FieldChecks"
             method="validateRequired"
       methodParams="java.lang.Object,
                     org.apache.commons.validator.ValidatorAction,
                     org.apache.commons.validator.Field,
                     org.apache.struts.action.ActionErrors,
                     javax.servlet.http.HttpServletRequest"
                msg="errors.required">
    </validator>
  </global>
</form-validation>
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
u still getting that error? did you rebuild project?
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Yes, I still ahve the error
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
dont know why its not working for you. it works fine for me!

copy paste this code in validation-rules.xml file and rebuild the project andrestart the server

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
          "validator_1_1_3.dtd">
<!--
  $Id: validator-rules.xml 54932 2004-10-16 17:02:16Z germuska $

   This file contains the default Struts Validator pluggable validator
   definitions.  It should be placed somewhere under /WEB-INF and
   referenced in the struts-config.xml under the plug-in element
   for the ValidatorPlugIn.

      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
                                                  /WEB-INF/validation.xml"/>
      </plug-in>

   These are the default error messages associated with
   each validator defined in this file.  They should be
   added to your projects ApplicationResources.properties
   file or you can associate new ones by modifying the
   pluggable validators msg attributes in this file.

   # Struts Validator Error Messages
   errors.required={0} is required.
   errors.minlength={0} can not be less than {1} characters.
   errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.

   errors.byte={0} must be a byte.
   errors.short={0} must be a short.
   errors.integer={0} must be an integer.
   errors.long={0} must be a long.
   errors.float={0} must be a float.
   errors.double={0} must be a double.

   errors.date={0} is not a date.
   errors.range={0} is not in the range {1} through {2}.
   errors.creditcard={0} is an invalid credit card number.
   errors.email={0} is an invalid e-mail address.

   Note: Starting in Struts 1.2.0 the default javascript definitions have
         been consolidated to commons-validator. The default can be overridden
         by supplying a <javascript> element with a CDATA section, just as
         in struts 1.1.

-->

<form-validation>

   <global>
   
      <validator name="required"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateRequired"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
                  msg="errors.required"/>

      <validator name="requiredif"
                 classname="org.apache.struts.validator.FieldChecks"
                 method="validateRequiredIf"
                 methodParams="java.lang.Object,
                               org.apache.commons.validator.ValidatorAction,
                               org.apache.commons.validator.Field,
                               org.apache.struts.action.ActionMessages,
                               org.apache.commons.validator.Validator,
                               javax.servlet.http.HttpServletRequest"
                 msg="errors.required"/>

      <validator name="validwhen"
          msg="errors.required"
                 classname="org.apache.struts.validator.validwhen.ValidWhen"
                 method="validateValidWhen"
                 methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       org.apache.commons.validator.Validator,
                       javax.servlet.http.HttpServletRequest"/>


      <validator name="minlength"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMinLength"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.minlength"
           jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>


      <validator name="maxlength"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMaxLength"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.maxlength"
           jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>



      <validator name="mask"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMask"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.invalid"/>


      <validator name="byte"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateByte"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.byte"
       jsFunctionName="ByteValidations"/>


      <validator name="short"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateShort"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.short"
       jsFunctionName="ShortValidations"/>


      <validator name="integer"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateInteger"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.integer"
       jsFunctionName="IntegerValidations"/>



      <validator name="long"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateLong"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.long"/>


      <validator name="float"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateFloat"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.float"
       jsFunctionName="FloatValidations"/>

      <validator name="double"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateDouble"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.double"/>


      <validator name="date"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateDate"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.date"
       jsFunctionName="DateValidations"/>


      <validator name="intRange"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateIntRange"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends="integer"
                  msg="errors.range"/>


      <validator name="floatRange"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateFloatRange"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends="float"
                  msg="errors.range"/>


      <validator name="creditCard"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateCreditCard"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.creditcard"/>


      <validator name="email"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateEmail"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.email"/>

      <validator name="url"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateUrl"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.url"/>

     <!--
       This simply allows struts to include the validateUtilities into a page, it should
       not be used as a validation rule.
     -->
     <validator name="includeJavaScriptUtilities"
            classname=""
               method=""
         methodParams=""
              depends=""
                  msg=""
           jsFunction="org.apache.commons.validator.javascript.validateUtilities"/>

   </global>

</form-validation>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Dear jaggernat,

I still have the same problem,
maybe comes from validation.xml ?

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE form-validation PUBLIC
     "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
     "http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">
         
<form-validation>
      <global>
            <constant>
                  <constant-name>login_length</constant-name>
                  <constant-value>^(\.{2,32})$</constant-value>
            </constant>
            <constant>
                  <constant-name>password_length</constant-name>
                  <constant-value>^(\.{6,})$</constant-value>
            </constant>
      </global>
      
      <formset>
            <form name="loginForm">
            
                <field property="login" depends="required">
                    <arg key="required.login"/>
                </field>
            </form>
      </formset>
      
      
</form-validation>
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
(Don't pay attention to global variables, nbeed to remove this)
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
>>>>  <field property="login" depends="required">

can you show me your form-bean where you have the field "login". you are using dynavalidatorform right?
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
package controllers.forms;

import org.apache.struts.validator.ValidatorForm;

public class LoginForm extends ValidatorForm{
      private static final long serialVersionUID = 1L;
      
      private String login=null;
      private String password=null;
      public String getLogin() {
            return login;
      }
      public void setLogin(String login) {
            this.login = login;
      }
      public String getPassword() {
            return password;
      }
      public void setPassword(String password) {
            this.password = password;
      }
}
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
you supposed to use dynavalidator form in struts-config.xml to define fields . dont think struts validation framework will work with validatorform.

go through this article carefully
http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html?page=1
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
do one thing:
in struts config add this under <form-beans> tag

<form-beans>

<form-bean name="xyz" type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
         <form-property name="login" type="java.lang.String" />
         <form-property name="password" type="java.lang.String" />
</form-bean>
            
</form-beans>

in <action tags> use this

<action path="/"
            name="xyz"  /xyz is the form-bean name above
            scope="request"
            validate="true"
            parameter="method"
            type="your action class" input="tiles.samepagewith errors">
            <forward name="abc" path="nextpage.display"/>
</action>

so what we are doing is instead of using  the above validatorform(your java bean) we are using dynavalidator form
named "xyz" n struts-config.xml
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
I still have the same error :

23-nov.-2006 22:02:07 org.apache.struts.validator.DynaValidatorForm validate
GRAVE: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
      at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:603)
      at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:533)
      at org.apache.commons.validator.Field.validateForRule(Field.java:766)
      at org.apache.commons.validator.Field.validate(Field.java:846)
      at org.apache.commons.validator.Form.validate(Form.java:290)
      at org.apache.commons.validator.Validator.validate(Validator.java:354)
      at org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:117)
      at org.apache.struts.chain.commands.servlet.ValidateActionForm.validate(ValidateActionForm.java:53)
      at org.apache.struts.chain.commands.AbstractValidateActionForm.execute(AbstractValidateActionForm.java:100)
      at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)



0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
(u can notice that it uses validate of DynaValidatorForm now ...
so I rebuilt the project correctly
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
do u have commons-validator.jar in web-inf/lib directory ?
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
commons-validator-1.3.0.jar
commons-logging-1.0.4.jar
commons-digester-1.6.jar
commons-chain-1.1.jar
commons-beanutils-1.7.0.jar
[...]
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
can yu download latest version
http://jakarta.apache.org/commons/validator/

i am running out of ideas :-0  . assuming its problem with commons validator.
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
1.3.0 is the latest version ...
:'(
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
In my struts-config :

[...]
<action
            path="/Login"
            type="controllers.submits.LoginAction"
            name="loginForm"
            scope="request">
</action>

[...]

<form-bean name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
         <form-property name="login" type="java.lang.String" />
         <form-property name="password" type="java.lang.String" />
</form-bean>

[...]
0
 
LVL 10

Accepted Solution

by:
jaggernat earned 500 total points
Comment Utility
<action
            path="/Login"
            type="controllers.submits.LoginAction"
            name="loginForm"
            scope="request">
</action>


You have to give validate=true and input="your present page".
:(



0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
The book I bought about Struts is a big shit,
sorry ...

Can u tell me what I should put in input ?
I don't know since  this action can come from several pages.
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
input =" the mapping for your login page , could be jsp or tile"  

0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
That's the problem, I have not a login page,
it's a menu on the left : http://www.lehall.org.

This menu is located in almost all the pages of the website.
That's why I say this action can come from more than one page (jsp)
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
what is the "mapping" of the page where you have your

loginname and password fields?


that mapping would be in struts-config.xml

0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
jaggernat,
I have nothing about this in my struts-config....
I make a new question,
u did enough in this one,
I hope u wills till support me, thanks.
0
 
LVL 10

Expert Comment

by:jaggernat
Comment Utility
yea, thats better. i think we are almost there.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now