Solved

Validator question

Posted on 2006-11-20
31
1,903 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 17
  • 14
31 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17984393
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
ID: 17985719
I will try jaggernat, thank you
0
 
LVL 9

Author Comment

by:matthew016
ID: 17989992
Dear jaggernat,

your code compile with dtd 1_1_3
but not with the latest dtd 1_3_0
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:matthew016
ID: 17990117
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
ID: 17991940
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
ID: 17998521
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
ID: 17999275
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
ID: 18004487
<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
ID: 18004502
u still getting that error? did you rebuild project?
0
 
LVL 9

Author Comment

by:matthew016
ID: 18004559
Yes, I still ahve the error
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 18004582
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
ID: 18004600
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
ID: 18004603
(Don't pay attention to global variables, nbeed to remove this)
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 18004643
>>>>  <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
ID: 18004647
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
 
LVL 10

Expert Comment

by:jaggernat
ID: 18004656
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
ID: 18004684
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
ID: 18004712
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
ID: 18004725
(u can notice that it uses validate of DynaValidatorForm now ...
so I rebuilt the project correctly
0
 
LVL 10

Expert Comment

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

Author Comment

by:matthew016
ID: 18004819
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
ID: 18004832
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
ID: 18004841
1.3.0 is the latest version ...
:'(
0
 
LVL 9

Author Comment

by:matthew016
ID: 18004851
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
ID: 18004866
<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
ID: 18004924
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
ID: 18004933
input =" the mapping for your login page , could be jsp or tile"  

0
 
LVL 9

Author Comment

by:matthew016
ID: 18004941
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
ID: 18004970
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
ID: 18004995
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
ID: 18004999
yea, thats better. i think we are almost there.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft is moving in-place eDiscovery & hold from ECP to EOP console under Content Search in Search and Investigation Options.  In this post, I will be showing you how to export emails to a PST file using the Content Search Options.
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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