This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 12769
    
    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: 61064
    
  66

"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: 61064
    
  66

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

Joined: Jan 10, 2002
Posts: 61064
    
  66

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 ]
 
Don't get me started about those stupid light bulbs.
 
subject: image not displaying in tomcat server