aspose file tools*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 FileUpload - request is nulled" Watch "Struts2 FileUpload - request is nulled" New topic
Author

Struts2 FileUpload - request is nulled

Kate Oakes
Greenhorn

Joined: Jul 15, 2008
Posts: 2

Hi!
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?).

struts.xml:


Action:


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
Greenhorn

Joined: Jul 15, 2008
Posts: 2

The interceptor reference overrides the default interceptor stack. Adding in the action configuration in struts.xml solved it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts2 FileUpload - request is nulled