Anshuman Nanda wrote:
>
> I am reading an HTML file through the servlet and displaying it on =
> the browser. The HTML page contains some gif files lying in the same =
> directory as the pages itself. When I display the pages through =
> servlet, the images does not get displayed on the browser. I am using =
> Java Web Server. Can anyone suggest, where should i place my images so =
> that it should get displayed when reading the html page through a =
> servlet.
The same place you would put them if you were not using a servlet.
Suppose your web structure is /{document root}/images
then your img tag would be <img src="/images/myImage.jpg">
or you could try <img src="../images/myImage.jpg">
Leaving the images in the servlets directory probably won't work.
an img tag like this: <img src="myImage.jpg">
gets sent by the browser as http://{server}/servlet/myImage.jpg
And this gets interpreted as a request for a servlet called myImage.jpg (at
least by NES 3.6 and JRun)
if your img tag is <img src="/myImage.jpg">
then that becomes http://{server}/myImage.jpg
K Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html