I am using Struts Validator Frame work to do both Client and Serverside
Validation. I am using Struts 1.2

My Validator is not triggring at all. I am trying to figure out the mistake
from the last two days, but no luck.

I am extending the ValidatorForm Class.

Can anyone help me with this one.

thanks

Here is the code.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd";>

<struts-config>
  <data-sources />
  <form-beans>
        <form-bean name="logonForm" type="com.yourcompany.struts.LogonForm"/>
  </form-beans>
  
  <global-exceptions />
  <global-forwards />
  <action-mappings>
        <action
      attribute="LogonForm"
      input="/MyJsp.jsp"
      name="logonForm"
      path="/Logon"
      scope="request"
      validate="true"
      type="com.yourcompany.struts.Logon">
      <forward name="success" path="/MyJspSuccess.jsp" />
      <forward name="failure" path="/MyHtml.html" />
    </action>
  </action-mappings>
  <message-resources parameter="com.yourcompany.struts.ApplicationResources"
/>
  
  <!-- Validator Configuration -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
  <set-property property="pathnames" 
                                value="/WEB-INF/validator-rules.xml, 
/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>

*************************************************************************


<!DOCTYPE form-validation PUBLIC 
          "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.0//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>

<form-validation>
  <formset>
    <form name="logonForm">
      <field property="username" depends="required">
        <arg0 key="prompt.username"/>
      </field>
    </form>
  </formset>
</form-validation>

**************************************************************

package com.yourcompany.struts;

import org.apache.struts.validator.ValidatorForm;

public class LogonForm extends ValidatorForm {
        private String username;
        private String password;
          
        public String getUsername() {
                return username;
        }
          
        public void setUsername(String username) {
                this.username = username;
        }
        
        public String getPassword() {
                return password;
        }
        public void setPassword(String password) {
                this.password = password;
        }
}

**********************************************************

http://www.nabble.com/file/7961/struts-config.xml struts-config.xml 
http://www.nabble.com/file/7962/validation.xml validation.xml 
http://www.nabble.com/file/7963/validator-rules.xml validator-rules.xml 
-- 
View this message in context: 
http://www.nabble.com/Validatoin-not-working-tf3603238.html#a10066448
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to