When we process the form data without file upload control in JSP. We can use JavaBeans 
in JSP, then the following will store all the request form data to MyObjectModel 
object:

 

<jsp:useBean id="om" class="MyObjectModel" />

<jsp:setProperty name="om" property="*" />

 

However, when we process the form data that contains file upload, and uses 
commons-fileupload, then we should approach the following, is that correct? 

 

if (item.isFormField())

{

      String name = item.getFieldName();

      String value = item.getString();

      

      MyObjectModel om = new MyObjectModel();

      if (name.equals("fieldName1"))

            ad.setFieldName1(value);

      else if (name.equals("fieldName2"))

            ad. setFieldName2(value);

      else if (name.equals("fieldName3"))

            ad.setFieldName3(value);

      //etc...

}

 

Please advise. Thanks!!

 

                
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Reply via email to