• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem showing image files  RSS feed

 
Syed Ullah
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am fairly new to Tomcat, so please bear with me.

I have an application that runs on a different web server in production, but for development
we use Tomcat (since it is easily available on a PC).

In one of the JSP files, there are image file references like this:



While this works fine with the webserver that runs in production, it does not work on Tomcat.
For it to work on Tomcat, I need to use the name of the webapp first:



I think the basic issue here is that, Tomcat thinks '/' means '<tomcat_install_dir>/webapps'

Is there some way to tell Tomcat that '/' means '<tomcat_install_dir>/webapps/mywebapp' for
the 'mywebapp' application?

The image files are under mywebapp/images

Thanks.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't actually a question about Tomcat specifically, it's a question about how web apps work in general. There's an entry in the Ranch's FAQ specifically about this question, too: RelativeLinks.
 
Syed Ullah
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!