You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/01/29 23:05:15 UTC

DO NOT REPLY [Bug 16569] New: - Server side validation with Struts does not function

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16569>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16569

Server side validation with Struts does not function

           Summary: Server side validation with Struts does not function
           Product: Struts
           Version: 1.1 Beta 3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: vivnat22@yahoo.com


I am trying to use the 1.1 Beta3 version and set up both client side and server 
side validations. I have a form field which needs to be an integer. The client 
side Javascript works fine as long as the entries are something like 'asdsa..' 
or 'asdsa1321321..'. But when the entry is like '123adasdsa..' (digits followed 
by characters) Javascript validation passes through and the form is submitted. 
I expect the server side validation to catch this error and return me to the 
input page. But there is no validation on the server side and the request is 
routed to the Action.

I have defined the action form in thee struts-config file as:
    <form-bean
      name="tanfAggregateDataForm"
      dynamic="true"
      type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="numAppsMonth1" type="java.lang.Integer" />
      <form-property name="numAppsMonth2" type="java.lang.Integer" />
      <form-property name="numAppsMonth3" type="java.lang.Integer" />
    </form-bean>

and the action mapping as

    <action
      path="/tanfAggregateData"
      type="acf.tdrs.data.action.TANFAggregateAction"
      scope="request"
      name="tanfAggregateDataForm"
      validate="true"
      input="/data/tanfdata.jsp">
      <forward name="success"   path="/common/message.jsp" />
    </action>

The validation.xml file listing is:

    <form name="tanfAggregateDataForm">
      <field property="numAppsMonth1" depends="required,integer">
        <msg name="integer" key="errors.custom.integer" />
        <arg0   key="dataitem.totalapps" />
        <arg1   key="label.month1" />
      </field> 
      <field property="numAppsMonth2" depends="integer">
        <msg name="integer" key="errors.custom.integer" />
        <arg0   key="dataitem.totalapps" />
        <arg1   key="label.month2" />
      </field>
      <field property="numAppsMonth3" depends="integer">
        <msg name="integer" key="errors.custom.integer" />
        <arg0   key="dataitem.totalapps" />
        <arg1   key="label.month3" />
      </field>
    </form>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org