my dog learned polymorphism*
The moose likes JSP and the fly likes Apache FileUpload: My form is going crazy! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Apache FileUpload: My form is going crazy!" Watch "Apache FileUpload: My form is going crazy!" New topic
Author

Apache FileUpload: My form is going crazy!

Aique Fernandez
Greenhorn

Joined: May 04, 2010
Posts: 3
Hi!. I'm really stuck, I hope anyone could help me.

This is my JSP



And this is my Servlet



When I complete the form with a text and a pdf the result of the prints are:

contenido:null
titulo:null
titulo:Ejemplo

¿How can be possible?. The parameter recovered with getAttribute works even when the form is multipart and it can't work in that way, and the parser of the commons upload returns everything null when parses the multipart data.

I hope some help, I'm stuck since yesterday :S. Thanks!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

You can edit your post by using the button.
Aique Fernandez
Greenhorn

Joined: May 04, 2010
Posts: 3
I've solved it!.

The code is ok. The reason of this strange behaviour is the Struts. I have a filter in the web.xml to redirect everything on my web application throught the Struts Dispatcher. Maybe because I'm uploading the file using a servlet instead an Struts action, the file can't be sent properly.
 
 
subject: Apache FileUpload: My form is going crazy!
 
Similar Threads
Can you read this?
html form,servlet
request.getAttribute returning null
CSS Not Rendering on JSP that is passed to from Servlet
JSP <a href> tags breaks page functionality