|
The reason the background gif is not showing up is because the HTTP server is not finding it in the place it thinks it should find it. Here is the scoop The author of the note has specified a body tag like so: <body BACKGROUND="xxxx.gif"> When this response goes back to the client (browser) it tries to display the html page that was generated out of the response. When it sees the Background attribute specified with the name of the image file specified it will try to get that image file to display it within the page. A new request will go to the HTTP server to get the image file. However the request will be formed as http://<server>:port/servlet/xxxx.gif. Since it will use the same url as the original request for the servlet except replace the servlet name with the image file name. In WebSphere 2.0x because of the Service statement /servlet/* in the HTTP config file this request will get handled by WebSphere instead of the HTTP server and the image file will never be found. To make this work there is a slight change necessary. Assuming the server had a directory like /images right under the root for example where images are kept then if this image is put in that directory and a Pass statement added to the HTTP config file like Pass /* /images/* and the servlet code is changed to use <body BACKGROUND="../xxxx.gif"> then it should work. The reason is that by giving a relative path to the current URL the browser will now generate a new request like the following for the image. http://<server>:port/xxxx.gif. Now when the HTTP server gets the request it will try to service it rather than send it to WebSphere since the /servlet/* pattern is not there anymore in the URL. And because of the Pass statement the /xxxx.gif will translate to the actual physical location (done by the HTTP server) -> http://server:port/images/xxxx.gif and it will be found and displayed correctly by the client. Hope this explains things. ***************************************************** Jai Goradia Duncan_Folkes@cuk.canon.co.uk on 07/13/2000 06:40:48 AM Please respond to JAVA400-L@midrange.com To: JAVA400-L@midrange.com cc: Subject: Servlet not displaying background GIF Hi, I am trying to display a background GIF file in my servlet running under Websphere 2.03. If I alter the code to use BGCOLOR the colour of the background changes, but I cannot get the servlet to display the background image. If I view the source from the Servlet web page and save this as an html file I can, when serving the web page from my AS/400, display the background gif. Below is an excerpt from the superclass which defines [some] of the html source: protected void outputHeader(PrintWriter out, String title) throws IOException flexLog(title + ": outputHeader()..."); out.print("<HTML><HEAD><TITLE>" + title + "</TITLE>"); out.println("</HEAD><BODY>"); out.print("<BODY BACKGROUND=\"as400.gif\">"); flexLog(title + ": outputHeader() executed."); } // end outputHeader() I am probably doing something daft but at the moment can't see the wood for the trees - anyone got any ideas? Dr Duncan E. Folkes Wizcom Data Limited * * * * * * * * * * * * * * * * * * * This email may contain confidential information which is intended for the required recipient only. If you are not the named recipient you should not take any action in relation to this email, other than to notify us that you have received it in error. If this email contains attachments you should ensure they are checked for viruses before opening them. +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.