Author
File Upload
rudresh kumar
Ranch Hand
Joined: Jan 04, 2006
Posts: 81
posted May 15, 2009 15:21:24
0
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
posted May 15, 2009 15:37:09
0
FYI, the same code works fine with normal jsp (non struts code)
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
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
posted May 15, 2009 15:58:30
0
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
posted May 15, 2009 16:01:35
0
Does this help?
Android apps – ImageJ plugins – Java web charts
rudresh kumar
Ranch Hand
Joined: Jan 04, 2006
Posts: 81
posted May 18, 2009 08:51:00
0
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
subject: File Upload