• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parsing files and text box values  RSS feed

 
sam barker
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am using a form containing fields to upload files as well as text boxes.
While parsing the form,
if item.isFormField()
then i get the fieldName and vlaue..since the textbox values have to be put in a bean i have a switch statement
like
case "fieldname1":bean.setmethod1(val1);
case "fieldname2":bean.setmethod2(val2);
and so on..is there a cleaner way..this will be ugly if the forum had many text boxes.
Cheers,
Sam
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually collect all the form fields into a Map.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!