This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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
GeeCON Prague 2014
subject: Image file path