tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luckypig <nb...@yahoo.com.cn>
Subject Re: Trouble displaying images
Date Wed, 11 Aug 2004 01:17:58 GMT
You'd better user relative path,you can use ContextPath+relative image path.

Xeth Waxman <xethw@yahoo.com> wrote:Hello: first time posting, and I am a complete
tomcat/servlet/java newbie, so please forgive me if I
ask a really stupid question. I have a servlet which
creates a web page, and included on the page is an
image. I can't figure out how to reference the image
via a relative path, so I am using an absolute path. 
The code looks like this:

...
body.append("">SRC='C:/jakarta-tomcat-5.0.12/webapps/ROOT/WEB-INF/Images/logo.gif'>");

The image displays fine under IE 6.0, but won't show
up in Mozilla/Netscpae/Firefox. Does anyone know why?
Also, if anyone knows the base path a servlet (not a
war, jar or an ear, since I don't know how to make
those and I can't get ant to install on my system
anyway; just a servlet dropped in
ROOT/WEB-INF/Classes) then I can make my paths
relative rather than absolute, which I would prefer.

Thanks again for any assistance, and for the service
those of you giving advice provide.

Xeth Waxman
Tucson, AZ



__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org





---------------------------------
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
美女明星应有尽有,搜遍美图、艳图和酷图
1G就是1000兆,雅虎电邮自助扩容!
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message