File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts Formfile Not Getting instantiated, <html:file property= sets to null" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Formfile Not Getting instantiated, <html:file property="theFile"/>  sets to null" Watch "Struts Formfile Not Getting instantiated, <html:file property="theFile"/>  sets to null" New topic
Author

Struts Formfile Not Getting instantiated, <html:file property="theFile"/> sets to null

Shailesh Phatak
Ranch Hand

Joined: Aug 27, 2009
Posts: 64
Hello Everyone,
Please help me to identify the issue:-

1) I am downloading the template from the secured website which asks for user id and password.
2) After this pop-up blocker blocks this file to open, for this I right click allow the file to download and download the file.
3) After this I go to to browse button selects the file and click on upload.
4) After this Browser shows the message " You are about to redirect to a connection which is not secure, The information you are sending to the current site might be transmitted to a non secure site. Do ou wish to continue? " I click yes.
5) After this a browser might send a new request because of which Formfile becomes null and hence FormFile.getInputStream(); comes null.
6) Can anyone help me out why the FormFile object is not set? Here is the code snippet:-

Code in jsp



Code of POJO class



Code for UploadAction


Code of upload Service here it fails since form.getTheFile() is coming null




NOTE:: This code was working good when the file was downloaded from local codebase


See Dreams With Open Eyes And Make It Real
 
Don't get me started about those stupid light bulbs.
 
subject: Struts Formfile Not Getting instantiated, <html:file property="theFile"/> sets to null