Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to browse & upload the image using struts2?

 
Deepthi Xavy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one suggest,what are all the external jars required while uploading an image by using struts2
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you would require "commons-fileupload-1.1.1.jar"
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you able to solve your problem ?
 
Deepthi Xavy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did in jsp,servlets....But just now started with struts2...so am not able to get through
 
Ankit Garg
Sheriff
Posts: 9527
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepthi Subramaniam wrote:i did in jsp,servlets....But just now started with struts2...so am not able to get through


Are you still having problem with it even after adding the apache file upload library?? If you want to know how it is done, then you can look a tutorial on the internet like this one...
 
Deepthi Xavy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried.......but dint get yet.........sujest some other link,or any sample code,if you have done that
 
Ankit Garg
Sheriff
Posts: 9527
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try all the steps given in that tutorial?? I didn't try to create the program given in that tutorial but I think it will work. Can you tell us the problem that you are facing. If you search on google a term like struts2 file upload example, you'll get a lot of tutorials and stuff...
 
Deepthi Xavy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai i wanna for image upload.........not for file upload......k
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi deepti.....i have sent you a personal message...
please check your inbox and reply me
 
Ankit Garg
Sheriff
Posts: 9527
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepthi Subramaniam wrote:hai i wanna for image upload.........not for file upload......k


An Image is after all a file. You can use filter to allow only images as given here. And don't use workds like k, use the full word ok...
 
Mukesh Ranjan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is FileUploadInterceptor in struts2.0.
Use this interceptor which will do all your work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic