我使用的是structs里的org.apache.struts.upload来上传文件,因为在一个form中有基本的字段和file的字段,因为设置了enctype="multipart/form-data",所以一般的字段就不能取到值了,请问怎么解决此问题?

解决方案 »

  1.   

    用struts 的form bean 处理,不用你自己考虑把。
      

  2.   

    <html:select property="categoryID">
        <html:optionsCollection name="categorySelect" property="values" value="key" label="value" />
    </html:select>categorySelect为保存在request中的ArrayList,这时他就会变为null,还有像这样
    String type = request.getAttribute("contentType").toString(); 通过getAttribute取到的就是null,提交页面后,就保存不了这个值了?
      

  3.   

    你仔细看看upload这个类.应该有方法可以取
      

  4.   

    用struts 的form bean 处理可以直接从form中得到