It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Image file path" Watch "Image file path" New topic
Author

Image file path

Matt Bucknam
Greenhorn

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: http://aspose.com/file-tools
 
subject: Image file path
 
Similar Threads
images display problem with dispatcher.forward()
Place JSP files in WEB-INF Folder
Servlet forward JSP, image problem
Stylesheet doesn't load in JSP
Rendering of Servlet output