Thanks Craig, Alex, and Baglan...
What I wanted to do in the end was this:
- I put the image in a subdirectory of the public_html directory.
- Called it using the following:
<IMG SRC="http://xxx.xxx.xxx.xxx:8080/images/mypic.gif">
There were 2 problems which make me second guess all of this:
1) I wasn't too sure how to indicate the subdirectory in relation to where the file
was stored
2) One of the pic had a name with spaces in it (apparently not a good idea!)
Anyway, I just want to thank you again and let you know that everything works fine
for now...
Jean
Jean Bresse wrote:
> Thank you Craig:
>
> I don't need to generate the gif file dynamically, but want to provide a URL to
> upload the image. All of this is a new to me so please forgive the simplicity of
> the question! I've tried the following without success:
>
> <IMG SRC="http://CS391674-A:8080/public_html/images/mypic.gif">
> <IMG SRC="http://CS391674-A:8080/images/mypic.gif">
> <IMG SRC="/images/mypic.gif" WIDTH=600 HEIGHT=120>
>
> "CS391674-A" is my computer name, and I did put the mypic.gif in the following
> directory: c:\JavaWebServer1.1.3\public_html\images
>
> The JWS was done using default installation.
>
> Your feedbacks are always appreciated...
>
> Jean
>
> "Craig R. McClanahan" wrote:
>
> > Jean Bresse wrote:
> >
> > > I was wondering about one thing about web page generation by a servlet.
> > > Say that you have a web page which contains a picture, or a background
> > > motif. Do you need a second servlet to service the picture itself?
> > >
> > > There are 2 reasons why I ask this:
> > >
> > > 1) With the code I wrote, I'm not able to do it using one servlet only
> > > 2) I know that the context of the servlet is set to "text / html". I'm
> > > only guessing here that the image is of a different context
> > >
> > > Your kind and informative feedbacks on this are MOST appreciated...
> > >
> > > Thanks,
> > >
> > > Jean
> > >
> >
> > When you use something like <img src="myimage.gif"> in your generated page,
> > the image is requested by the brower in a separate HTTP request from the one
> > that requested this page. If your image is static, you could just set the URL
> > of the image to point at a web server to get it, or (if your servlet engine
> > serves files as well) just let the servlet engine serve it. On the other
> > hand, if you need to dynamically create the image (say, you were graphing some
> > data that was dynamically selected from a database) you might want to have a
> > servlet create it. The key is whatever the image URL points at.
> >
> > Craig
> >
> > ___________________________________________________________________________
> > 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
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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