我的Jsp页面:
<%@ page contentType="text/html;charset=GBK" language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<html:messages id="msg" message="true" bundle="phoneRecord">
<bean:write name="msg"/><br/>
</html:messages><html:errors bundle="phoneRecord"/>
<html:javascript formName="uploadRecordsForm"/>
<html:form method="post" action="uploadRecords.do" 
enctype="multipart/form-data" onsubmit="return validateUploadRecordsForm(this);">
<bean:message key="label.phoneRecord.upload.select" bundle="phoneRecord"/>
<html:file property="file"/>&nbsp;<html:submit/></html:form></html:html>validation.xml文件片段:
<form name="uploadRecordsForm">
<field property="file" depends="required">
<msg name="required" key="label.phoneRecord.upload.noFile"/>
</field>
</form>struts-config.xml文件片段:
        <form-bean
            name="uploadRecordsForm"
            type="org.apache.struts.validator.DynaValidatorForm">
            <form-property
                name="file"
                type="org.apache.struts.upload.FormFile"/>
        </form-bean> 在只采用服务器端校验的时候一切正常,在使用客户端校验的时候,整个页面不能显示。

解决方案 »

  1.   

    <html:javascript formName="uploadRecordsForm" dynamicScript="true" staticScript="false"/>
      

  2.   

    <html:javascript formName="uploadRecordsForm" dynamicScript="true" staticScript="false"/>这种方法没有用,一样是报错。
      

  3.   

    我机器上运行struts自带的例子,一点问题都没有。
    我把自己的Jsp拷贝到struts自带的例子应用里面去,添加相应的配置以后,访问的时候,报一样的错。
    真是郁闷!!
      

  4.   

    你有没有在struts-config.xml中,
    在action中,把validate="true"该为validate="false"
    你原来是用服务器端验证的,validate是应该等于ture,现在你是用客户断验证的,改为false
      

  5.   

    楼主,你跟踪进去看看有没有运行到action里面?
      

  6.   

    当然有,我用的是ForwardAction
    配置如下:
    <action path="/showUploadRecordsForm"
    type="org.apache.struts.actions.ForwardAction"
    parameter="uploadRecordsPage"
    validate="false"/>就是在生成页面的时候出的问题。也就是说,还没等到提交表单,在显示表单的时候出错的。
      

  7.   

    <action path="/showUploadRecordsForm" 
    type=""  
    name="uploadRecordsForm"     
    scope="request"      
    input="/showUploadRecordsForm"
    validate="true">     
    <forward name="success" contextRelative="true" path=""/> 
    </action> 
    你在action中指定你要映射的form
      

  8.   

    我用的是ForwardAction,应该不需要指定映射的Form吧?
      

  9.   

    可能是jar版本的问题,重新换一下看看。