dcsimg
How to add image in Java Servlet?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Venix_H
Posted On:   Saturday, August 3, 2002 02:05 AM


Hi! I have a problem inserting image in my java servlet code. I try to use html code but it doesnt show up. I cant set background as well. Can you help me?! I am totally new in this Java Servlet.Thanks

Re: How to add image in Java Servlet?

Posted By:   Lasse_Koskela  
Posted On:   Saturday, August 3, 2002 08:53 AM

Start by checking out the resulting HTML.


My guess would be that your image tag has wrong path (absolute vs relative path?).

Re: How to add image in Java Servlet?

Posted By:   Anonymous  
Posted On:   Saturday, August 3, 2002 02:59 AM

The only thing that you should do in your servlet is write out HTML for an IMG tag with a SRC attribute to an image file on your webserver.


Remember, a servlet is just a very dynamic way to generate HTML text!


If you produced an IMG tag in your HTML code (you can verify this by viewing the HTML source in your browser), but your image doesn't show up, then the uri to the image is incorrect.


Hope this helps.


Regards,

G√ľnther Van Roey.

http://www.javacoding.net
About | Sitemap | Contact