This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes How to instantiate a new FormFile object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to instantiate a new FormFile object" Watch "How to instantiate a new FormFile object" New topic

How to instantiate a new FormFile object

Medha kamat

Joined: Aug 22, 2002
Posts: 21
I have a form that uploads a file.Form uses FormFile object for
uploading of the file.Uploading works just fine.Problem i am having is
while wrtitng an automated test.In the test i am seting a form using setActionForm.Now as i mentioned in this form i want to set a FormFile object and that's where i am struggling

HolidayFeedUploadForm holidayFeedForm = new HolidayFeedUploadForm();
DiskFileItem fileItem = new DiskFileItem("uploadFile","application/,text/xml",true,
"myfileName",1200, null);
CommonsMultipartRequestHandler mp = new CommonsMultipartRequestHandler();
CommonsMultipartRequestHandler.CommonsFormFile dd = CommonsFormFile(fileItem);

It complains about visiblity of CommonsMultipartRequestHandler.
CommonsFormFile.I know that CommonsFormFile is an inner class and
package access is private.All i want to do is create a new FormFile
object and set it on the form.How would i achieve that?

I agree. Here's the link:
subject: How to instantiate a new FormFile object
jQuery in Action, 3rd edition