Hi John,

Simply pass the url for the image to a servlet,  open the url and write it
into the output stream.

Below is the servlet code:
       try {
                urlGif= request.getParameter("urlGif");
            }
            catch( Exception e) {
                 //do something
            }
            if (urlGif != null) {
                try  {
                    URL url = new URL(urlGif);
                    URLConnection urlConn = url.openConnection();

                    InputStream is = url.openStream();
                    // Let the run-time system (RTS) know that we want input.
                    urlConn.setDoInput (true);

                    // No caching
                    urlConn.setUseCaches (false);
                    response.setContentType(urlConn.getContentType());
                    int oneChar;
                    while ((oneChar = is.read()) != -1)
                        out.write(oneChar);
                }
                catch(MalformedURLException e) {
                    out.println("malformed gif");
                }
              out.close();


>From the client:
build the URL using the servlet as the URL location: where imageSouce is the
url for the GIF

  URL reference = ((HTMLDocument)getDocument()).getBase();
   String imageLocation =  "http:/hostname/servlet/SomeServlet?urlGif=" +
imageSource;
 URL url = new URL(reference,src);
  Image fImage = Toolkit.getDefaultToolkit().getImage(url);


Hope this helps.

Don

___________________________________________________________________________
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

Reply via email to