wood burning stoves 2.0*
The moose likes Struts and the fly likes How to convert File object to Formfile object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to convert File object to Formfile object" Watch "How to convert File object to Formfile object" New topic
Author

How to convert File object to Formfile object

venkatesh warlu
Ranch Hand

Joined: Mar 11, 2008
Posts: 33
Hi all,

I am having a file object. I need to convert it into FormFile object. It shows classcastexception when try to type cast it. Please help.

File reqFile = new File("file.txt");
myForm.setReqFile(reqFile);

The setReqFile is a private Formfile variable in my form like "private FormFile reqFile;"

Thanks in advance!!

Regards
Venkat
 
Consider Paul's rocket mass heater.
 
subject: How to convert File object to Formfile object