File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes image not displaying in tomcat server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "image not displaying in tomcat server" Watch "image not displaying in tomcat server" New topic
Author

image not displaying in tomcat server

bhates bhates
Greenhorn

Joined: Oct 18, 2008
Posts: 1
I have apache tomcat installed on G:\
I have a file.jsp and image.jpg at webapps\root
wat should be the correct url to display the image.jpg in the file.jsp on apache tomcat server.
Please help
Thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
If you have Tomcat installed correctly so that you can get the normal Tomcat startup page, then you can study the way that the Tomcat example jsp pages refer to images.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

"bhates bhates", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
asdf lkjh
Greenhorn

Joined: Oct 17, 2008
Posts: 12
If you image and jsp file are under same directory, you can give just a name of the image.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

"sush pop", please check your private messages for a VERY important administrative matter.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Originally posted by sush pop:
If you image and jsp file are under same directory, you can give just a name of the image.
Which is a very poor way to structure a web app.

See this JSP FAQ entry for information on properly addressing resources in a JSP.
[ October 18, 2008: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image not displaying in tomcat server