tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Propes, Barry L" <barry.l.pro...@citigroup.com>
Subject RE: Links to relative URL's from a JSP
Date Mon, 24 Jul 2006 19:43:35 GMT
Mike,

That's not the case for me. I did, however, choose to make an images directory in the webapps
folder, so that all my JSPs do indeed source back one directory, like you noted, src="../images/image.gif"
for example.

Try restarting Tomcat with the image in the JSP sourced like the HTMLs and see. See if it
picks up your change.

-----Original Message-----
From: Mike Molina [mailto:synod7@hotmail.com]
Sent: Monday, July 24, 2006 12:32 PM
To: users@tomcat.apache.org
Subject: Links to relative URL's from a JSP


This thread is related to relative URL within JSP's and how they refer to 
the local directory structure in a web application.

My directory structure in Tomcat goes something like this:

webapps/inprogress/WebContent
(Accessed through Tomcat as such: http://127.0.0.1:8080/inprogres/WebContent

where WebContent contains my JSP and HTML files, WEB-INF, etc.

When creating img links to image files in the WebContent folder, I noticed

1) HTML files can use the correct local pathname, e.g., <img 
src="imagname.jpg">

however,

2) JSP files, even though accessing image files in the same directory must 
use the previous directory, e.g., <img src="../imagename.jpg"> even though 
the images are contained in the same directory.

My assumption is that JSP files are "rooted" in the WEB-INF directory and so 
must use the previous directory notation back up a directory to access the 
images contained the WebContent folder where everything else is.

Thus, I have two questions:

1) Why does this occur, and how can I modify my xml configuration files so 
that JSP's reference links exactly as an html file in the same directory 
would?

2) How can I change the root folder of tomcat to the 
webapps/inprogress/WebContent directory, which xml files, and how exactly 
should I modify them?

Thanks,
Mike M.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message