Exception with file upload without using form bean

Discussions

General J2EE: Exception with file upload without using form bean

  1. I am newbie to file upload by using strut, I have an action, but did not use form bean, then I got an erro no matter how I tried, please take a look to see where is the problem:

    the form in test.jsp

    <form action="/actions/sales/customer/test"
    enctype="multipart/form-data" method="post">

    Please specify the path of the logo:<br>
    <input type="file" name="filename" size="40">


    the strut-config.xml for this action
    <action
           path="/actions/sales/customer/test"
                                 type="com.mailamerica.wts.FileUploadAction"
                      input="/forms/error.jsp">
     
                     <forward name="success"
                              path="/index.jsp"/>
                     
                     <forward name="fail"
                              path="/forms/login.jsp"/>
                
                 </action>

    and I have a FileUploadAction.java file, but the control even don't come to the action file,I only got exception for
    "Can not retrieve definition for form bean null...."

    can anybody give me any hint? does form bean is a must for file upload to use struts? I use the common-fileupload.jar component and tutorial from jakarta website and did not follow the tutrial of struts of fileupload to use form bean. because I may have more control over the file if I don't use the form bean for struts.
  2. Every action must have a form bean associated with it. Its mandatory by the struts spec.