• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Interceptor not working

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all;
I am implementing such File uploading application as well as i am written an fileUpload interceptor in struts.xml file but
i dont know how to get related values of file into my Action class.

When i use like;
public String uploadFile()
{
File filePath = new File("/",uploadfile.getUploadFileName());
System.out.println(filePath);
return SUCCESS;
}


then it throws an error follows;
Caused by: Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) - [unknown location]
at org.apache.struts2.config.BeanSelectionProvider$ObjectFactoryDelegateFactory.create(BeanSelectionProvider.java:247)
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:134)
... 20 more


What is the mean of this error
Can Somebody tell me.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you are trying to say here. If you are using the default fileUpload interceptor provided by struts 2.x, then all you need to do is expose action properties corresponding to the file upload form field. So if your form which upload the file looks like this

Then in your Action class you can have three properties which will be automatically set the fileUpload interceptor. These are
The first object is the File object of the uploaded file, 2nd is the mime type of the file and the third is the name of the uploaded file...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also make sure you have commons-io and commons-fileupload libraries deployed.
reply
    Bookmark Topic Watch Topic
  • New Topic