I had similar problems in the initial development of my webapp.
Ultimately, the solution we got to work was to make sure all the
relative paths were relative to the jsp file's location, as opposed to
being relative to the context root.

For example, I have webapps\application\pages and
webapps\application\includes.  

For a jsp in the pages folder, a reference to the jsp that encapsulates
the page footer (found in the includes folder) would look like:

<[EMAIL PROTECTED] file="../includes/page_footer.jsp"%>

Hope that helps,

Roger Alix-Gaudreau

-----Original Message-----
From: Jignesh Shah [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 06, 2006 9:48 AM
To: Tomcat Users List
Subject: Re: war file deployment question

Yes David, I do use relative path in my jsp's. What
wonders me is I have lots of images in the images
directory and I use them through relative path also
and they work fine. Its only when it comes to css/xsl
files that it cannot access. This stuff again works
fine with other webserver, so I am missing some
necessary jar file in the classpath. I have the
servlet-api.jar file in the classpath.

Thanks,
Jignesh

--- David Smith <[EMAIL PROTECTED]> wrote:

> How are you accessing the css/xsl files? Sounds like
> you are attempting 
> to open then with standard Java IO calls and
> relative paths. If that's 
> the case, you might want to consider looking at 
> javax.servlet.ServletContext#getResource() or 
> javax.servlet.ServletContext#getResourceAsStream().
> These methods allow 
> you to use context relative paths to resources.
> 
> --David
> 
> Jignesh Shah wrote:
> 
> >Hi,
> >
> >I have a war file that works fine under JRun and
> >Jetty. Now when I deploy it under
> >$CATALINA_HOME/webapps directory, the war file
> creates
> >its usual tree under webapps. Now this is what it
> >looks like after deployment:
> >/webapps
> >  /myapplication
> >    lots of jsps
> >    css (where I have css and xsl files)
> >    images
> >    WEB-INF
> >
> >Now my problem is when I access some jsp's after
> >deployment, in turn they need to access some xsl
> files
> >in css directory, which it cannot find under tomcat
> >after deployment. The error says that its looking
> for
> >my css/xsl files under $CATALINA_HOME/bin directory
> >from where I start my tomcat. So again, the
> question,
> >does everything under myapplication is not under
> >classpath ? What do I do to set it so that it can
> find
> >my css/xsl files.
> >
> >thanks,
> >Jignesh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to