tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shanky" <sha...@home.com>
Subject Path problem
Date Mon, 30 Oct 2000 08:25:25 GMT
Hello,

Sorry for a long mail. Please help me with this. 

Problem:
--------
Our company has lot of small teams developing websites. we use a central jsp engine(tomcat)
for development. In order to refer to pages we use relative paths and it is causing problems.
this is the situation.

This is our file structure.

c:\programs\jrun\data\projects\proj1
c:\programs\jrun\data\projects\proj1\index.jsp
c:\programs\jrun\data\projects\proj1\Top.jsp
c:\programs\jrun\data\projects\proj1\images\image1.gif
c:\programs\jrun\data\projects\proj1\aboutus\mission.jsp

top.jsp is used by all the pages thru out the project. 
index.jsp includes top.jsp as <%@ include file="Top.jsp" %>
and Top.jsp has reference to image1.gif as <img width=600 height=25 src="images/image1.gif">
mission.jsp includes top.jsp as  <%@ include file="Top.jsp" %>
but this causes a problem - the image1.gif gets referenced in mission.jsp as 
<img width=600 height=25 src="images/image1.gif"> and thats a wrong path and the image
is not shown.


Work around:
------------
So we decided to use absolute paths. now that causes an entirely different problem.


Problem with workaround:
-----------------------
When we refer to other pages with absolute paths, we have to specify the whole "/projects/proj1/....."(c:\programs\jrun\data
is the root), but this is not the path that will be in production.
Using virtual directories is also ruled out as we have to mention the virtual directory name
in the file path.

Does anybody have a different approach we can use.

Solution being considered:
--------------------------
One of things we were thinking is modifying tomcat code to replace the path of all files to
the absolute path at runtime.


thanks,
Shankar


Mime
View raw message