File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Image file path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Image file path" Watch "Image file path" New topic

Image file path

Matt Bucknam

Joined: Dec 08, 2000
Posts: 23
I wonder why the images show up in my JSP when I call it directly but they do not if I forward to the JSP from within a servlet. It seems as if server path is different depending on whether the servlet/jsp server handles the request or it comes through the browser. Does anyone know a way to use relative image paths that will work whether you call the jsp directly or forward to it from a servlet?
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Try to use the method sendRedirect like this:
response.sendRedirect("http://...");//the full path of your jsp
I agree. Here's the link:
subject: Image file path
It's not a secret anymore!