[open-training-community] JSP help

3 views
Skip to first unread message

shikha jain

unread,
May 14, 2010, 5:10:20 AM5/14/10
to open-traini...@googlegroups.com
Hello Everyone,

 Can anyone please tell how to display images, lying outside tomcat, in browser using JSP?

Best Regards,
Shikha Jain.

--
You received this message because you are subscribed to the Google
Groups "open-training-community" group.
To post to this group, send email to
open-traini...@googlegroups.com
To unsubscribe from this group, send email to
open-training-com...@googlegroups.com
For more options, visit this group at
http://groups.google.co.in/group/open-training-community?hl=en-GB

Shardul Bhatt

unread,
May 14, 2010, 6:06:40 AM5/14/10
to open-traini...@googlegroups.com
Are you looking for something like what is in the attachment...?

Regards,
Shardul.
ImageTest.html

Pravin Jain

unread,
May 14, 2010, 9:27:04 AM5/14/10
to open-traini...@googlegroups.com
You need to ensure that tomcat has rights to read from the directory containing the images.
Next you let this directoryname be known to your application by setting up thru the context param in web.xml file.
And then you can create InputStream to the images in the directory, and use the javax.imageio.ImageIO class's
methods to load the images on the server side if needed or you can simply set the contenttype to the image/xxx
and write the content of the image file to the resopnse's OutputStream.


On Fri, May 14, 2010 at 2:40 PM, shikha jain <shk_...@yahoo.com> wrote:
Reply all
Reply to author
Forward
0 new messages