This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes File Upload Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "File Upload" Watch "File Upload" New topic
Author

File Upload

rudresh kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 81
Hi All,

I have been trying to upload a file using commons File Upload.

There are no compilation Errors.

Following is the code on struts action



The result of the last line is "false"; due to which the program does not proceed further. Would like to know the reason of why it is "false".

Following line is included in the jsp


Thanks
rudresh kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 81
FYI, the same code works fine with normal jsp (non struts code)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

Have you compared the HTML rendered by Struts to see where the difference lies?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
rudresh kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 81

Hi

Following are the html rendered on the browser

Struts



jsp



Struts actions class is blank, it just routes back to 'uploadsuccess.jsp".

I had printed the following on 'uploadsuccess.jsp'

Iterator itr = items.iterator();
out.println("<h1>"+itr.hasNext()+"</h1>");


It is True for jsp page and False for struts page. Basically works fine for normal jsp, but fails for struts based jsp

Thanks

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35250
    
    7
Does this help?


Android appsImageJ pluginsJava web charts
rudresh kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 81
Hi

The code in the above link is same as my code, but the behaviour is still the same. Does not work for Struts code

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Upload
 
Similar Threads
upload.parseRequest(request); giving null.
File upload issues
File upload
getting nullPointerException on line upload.parseRequest(request);
request.getParameter() returns null