my dog learned polymorphism
The moose likes JSP and the fly likes Include problems Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Include problems" Watch "Include problems" New topic
Author

Include problems

Dave Matthews
Greenhorn

Joined: Jun 11, 2002
Posts: 15
I'm including a JSP page inside another, the second page is in a different directory and so the images cant be found as the path is now screwy. The images arent in the root directory and I cant hardcode their path either, so I put an attribute in the web-xml that gives me the path to the images directory and use that. Is this the way to do things or is there a way to use the relative path like you can in asp?
hanumanth reddy
Ranch Hand

Joined: Jun 12, 2000
Posts: 118
Use ./../../ notation to locate your images form the current directory


<a href="http://www.jobklub.com" target="_blank" rel="nofollow">http://www.jobklub.com</a><br /> 'Add Job To Life'
Jose Velarde
Ranch Hand

Joined: Sep 11, 2002
Posts: 78
You can define a Context Root in the deployment descriptor. This way, you can refer to a relative URL in your include. Are you using Include directive or Include Action?
 
I agree. Here's the link: jrebel
 
subject: Include problems
 
Similar Threads
accessing our own web application without changing the default root
Preloading images ??
Import Statement
images display problem with dispatcher.forward()
Write an Image From Servlet