就是下面的jsp文件
运行就出现上面提到的错误<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=GB2312" pageEncoding="GB2312" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head>
<TITLE>uploadfile.jsp</TITLE>
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
</head><body bgcolor='white'>
<table border="0" cellpadding="0" cellspacing="0" width="140">
<tr>
<td colspan="2"><p class="note">file://</p></td>
<html:form action="/fileupload.do">
              <td><html:file size="7" property="theFile" /></td>
    </tr>
    <tr>
<td>&nbsp;&nbsp;<html:image src="img/go.gif" alt="GO" /></td>
<td><html:text size="7" property="value" /></td> 
</html:form>
</tr>
</table>
</body>
</html:html>

解决方案 »

  1.   

    struts-config.xml中<form-bean>设置了么?如何设置的
      

  2.   

    设置了,设置如下:
             
             <!-- 表单 Bean -->
             <form-beans>
    <form-bean name="UploadForm" type="com.FileUploadForm">
    </form-bean>
    </form-beans>表单 Bean 如下:import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.*;
    import org.apache.struts.upload.*;public final class FileUploadForm extends ActionForm 
    {
    protected FormFile _theFile;
    protected String _value;    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) 
    {
            ActionErrors errors = new ActionErrors();
            System.out.println("On Validate");
            return errors;
        }
    public FormFile getTheFile() {
    return _theFile;
    } public void setTheFile(FormFile theFile) {
    _theFile = theFile;
    } public String getValue() {
    return _value;
    }
    public void setValue(String value) {
    _value = value;
    }
    }
      

  3.   

    改为:
    <html:form action="/fileupload.do" enctype="multipart/form-data">
      

  4.   

    OK!
    ExceptionFactory兄弟多谢了!
    这20分就给你了