Actually am trying to user's photo The need is i have to fetch the user's image file and store it in a common folder and how can i retrieve that image from that path
posted 10 years ago
I'm not totally sure I understand the question, but it sounds like you have image files that are on the server's file system, but not in the context path of your web application and you want to display images from those files. Is that right?
You would do this by using the java.io classes to read the file and then write the output to the HttpServletResponse objet's Output Stream.
Fortunately for you, one of the examples in the struts-examples.war file (comes with the download) does exactly this. Unpack the war file and take a look at org.apache.struts.webapp.exercise.ImageAction. You will see how it's done.