aspose file tools*
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

Win a copy of Spring in Action this week in the Spring forum!
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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Image file path