File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 FileUpload - request is nulled 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 "Struts2 FileUpload - request is nulled" Watch "Struts2 FileUpload - request is nulled" New topic

Struts2 FileUpload - request is nulled

Kate Oakes

Joined: Jul 15, 2008
Posts: 2

I have a problem with file upload in Struts2. Everything works fine until I add <interceptor-ref name="fileUpload"/> (even without any parameters) to the action configuration - it results in request being null. If I don't add this line, I get the uploaded file and there aren't any problems with the request. But since I have to restrict what can be uploaded I have to add the interceptor-ref. I use Struts 2.0.11 and Spring 2.5.5. My application also uses Struts 1.2.9 (might this be a problem?).



CaseAction: (this is my base action)

I would be thankful for any help, or any explanation why this happens, if this is the correct behaviour.
[ July 22, 2008: Message edited by: Kate Oakes ]
Kate Oakes

Joined: Jul 15, 2008
Posts: 2

The interceptor reference overrides the default interceptor stack. Adding in the action configuration in struts.xml solved it.
I agree. Here's the link:
subject: Struts2 FileUpload - request is nulled
jQuery in Action, 3rd edition