Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filpath to in DHTML image.src in a JSP page

Status
Not open for further replies.

Gunnar99

Programmer
Apr 22, 2005
9
SE
I'm building the tree menu file tree_items.js in a servlet/JSP.

One thing that doesn't work is the icons in the menu structure.

They are specified with image.src(filepath).
The JSP files are located under the application map in Tomcat and the icons are in a map called icons in the application map. So image.src(icons/imagename.gif) is used as the filepath. And this works fine if I run the page as a HTML file. But it doesn't work for a JSP file coming from Tomcat.
I have tried different variants of the filepath; an absolute filepath from C: and to have the the imageicons in the same map as the JSP file and just use image(imagename.gif). But it doesn't work. Anyone who has an idea?

/Mats
 
OK.
I have discovered the error.
I must use an absolute path from the application directory.
E.g. /WebTemplate/icons/imagename.gif.
And then everything works perfect.
And I'm happy!

/Mats
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top