Your input list "/login.jsp" but your other JSP's are listed under the /jsp
directory, SO, should your input be something different to get rid of the
page not found error BEFORE you mess with the Validator and claim it is the
source of all problems?

Instead of:
input="/login.jsp"

Is the file here (like your other examples for "Success" and Failure"):
input="/jsp/login.jsp"

Also, are you sure your action is forwarding to the "success" forward using
the correct CASE-sensitive spelling (i.e. "Success" not "success") ?

Regards,
David

-----Original Message-----
From: Arindam Samanta [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 10, 2005 5:47 AM
To: Struts Users Mailing List
Subject: ERROR: Server side validation using Validation framework




Hi,

I am new in struts.  I am getting 'Page can not be displayed error when I
click on 'SAVE' button. validation is working fine when I implemented
client side validation to add following line
  <html:javascript staticJavascript="true" dynamicJavascript="true"
formName="loginForm"/>
But when I removed above code from jsp I faced page not found error but it
is not throwing any error into server. My Form class extends from
ValidatorForm.  My xml are,

 ********************struts-config.xml***********************
 <form-bean name="loginForm" type="com.ual.mars.form.LoginForm"/>
   <!-- ========== Action Mapping Definitions
============================== -->
  <action-mappings>
    <action
          path="/login"
          type="com.ual.mars.action.LoginAction"
          scope="request"
          name="loginForm"
          validate="true"
          input="/login.jsp">
          <forward name="Success" path="/jsp/employeedeatils.jsp"
redirect="true"/>
          <forward name="Failure" path="/jsp/loginform.jsp"
redirect="true"/>
    </action>

************************validation.xm*******************************
<form-validation>
<global>
<constant>
</constant>
</global>
  <formset>
  <form name="loginForm">
       <field
      property="userName"
      depends="required,mask">
      <arg0 key="userName.problem"/>
      <var>
        <var-name>mask</var-name>
        <var-value>^[a-zA-Z]*$</var-value>
      </var>
    </field>
     <field
          property="password"
          depends="required,mask">
          <arg0 key="password.problem"/>
          <var>
            <var-name>mask</var-name>
            <var-value>^[a-zA-Z]*$</var-value>
          </var>
    </field>
   </form>
  </formset>
</form-validation>

********************validator-rules.xml*******************
<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">

         <javascript><![CDATA[
            function validateRequired(form) {
                var bValid = true;
.....
....

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

Please help me.




Thanks,
Arindam


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

Reply via email to