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 Struts and the fly likes How to set a image path in my bean? 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 » Frameworks » Struts
Reply Bookmark "How to set a image path in my bean?" Watch "How to set a image path in my bean?" New topic
Author

How to set a image path in my bean?

rakshini nithya
Ranch Hand

Joined: Jun 15, 2006
Posts: 39
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
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to set a image path in my bean?
 
Similar Threads
Image display in jsp
get image from database
Problem in viewing uploaded images
how to give path for image in eclipse
image upload quary:need help