You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by marc <wd...@wilson.dk> on 2005/09/19 12:20:04 UTC
Reading image outside webapp contextpath??
I'm making a project that makes a picture gallery that has to be
accessible throw web, wap, webdav and file sharing. The project
consisting of a ejb backend and struts frontend(using velocity as
presentation).
I have made the EJB backend so that each dir with pictures in has a xml
file contaning all the pictures file address, thumbnail file address, a
wapnail file address and a name.
Now my problem is in the sturts frontend, when I what to show the
gallery. Tomcat will not show the picture because it is outside me
webapp contextpath.
How do I make tomcat/struts look in this "shared" dir where I got me pic?
Or do I have to do it in a other way?
This is my html:
<img src="C:/ProjectGallery/web/testGallery/webthumb/T_billed4.jpeg"
alt="C:/ProjectGallery/web/testGallery/webthumb/T_billed4.jpeg" >
If this is the wrong forum then pls let me know so that I can post in
the right place.
Thank you all very much ;-)
/Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Reading image outside webapp contextpath??
Posted by Murray Collingwood <mu...@focus-computing.com.au>.
The <img src=...> tag is evaluated by the browser (not the server), therefore when this
code arrives at your users browser it is going to look for the image on their local hard
drive - obviously it won't be there.
You will probably need to set up an action class to read and write the image back to the
user. I copied mine from here http://wiki.apache.org/struts/StrutsFileDownload
Kind regards
mc
On 19 Sep 2005 at 12:20, marc wrote:
> I'm making a project that makes a picture gallery that has to be
> accessible throw web, wap, webdav and file sharing. The project
> consisting of a ejb backend and struts frontend(using velocity as
> presentation).
> I have made the EJB backend so that each dir with pictures in has a xml
> file contaning all the pictures file address, thumbnail file address, a
> wapnail file address and a name.
>
> Now my problem is in the sturts frontend, when I what to show the
> gallery. Tomcat will not show the picture because it is outside me
> webapp contextpath.
> How do I make tomcat/struts look in this "shared" dir where I got me pic?
> Or do I have to do it in a other way?
>
> This is my html:
>
> <img src="C:/ProjectGallery/web/testGallery/webthumb/T_billed4.jpeg"
> alt="C:/ProjectGallery/web/testGallery/webthumb/T_billed4.jpeg" >
>
>
>
>
>
> If this is the wrong forum then pls let me know so that I can post in
> the right place.
>
> Thank you all very much ;-)
>
> /Marc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.25/102 - Release Date: 14/09/2005
>
FOCUS Computing
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.25/102 - Release Date: 14/09/2005
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org