• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to set a image path in my bean?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Poop goes in a willow feeder. Wipe with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic