This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

File Upload

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI, the same code works fine with normal jsp (non struts code)
 
Marshal
Posts: 67295
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you compared the HTML rendered by Struts to see where the difference lies?
 
rudresh kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this help?
 
rudresh kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
This is my favorite show. And this is my favorite tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!