commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Smith <apn...@yahoo.com>
Subject process regular fields in html form
Date Fri, 15 Oct 2004 17:56:42 GMT

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.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message