Hi,

This has been asked before, but I have yet to see a reply that answers what
I am after. In my case, we have two (or more) web-apps deployed (as Servlet
2.2 web-apps, either expanded or using .war files). In each web-app, I have
various JSP pages that have href links, form actions, and img src links. My
question is, can I use the following:

<img src="/images/image.gif">

or

<a href="/path/page.jsp"></a>


I recall seeing a problem with this when I deployed two web apps in the same
container. For some reason, I had to do ./path/page.jsp in order to get to
the page in the existing web-app. The main problem seems to lie in the
"root" web application and those that are accessed via a path. For example,
the root web application, which is our MAIN site, is ofcourse, the / root.
Therefore www.mycompany.com goes to this web application. It has /images
folder, /WEB-INF/classes, etc. Then, I have another web-app that starts from
the /admin path. So, in the admin web-app, if images use the <img
src="/images/path/image.gif"> format, is it infact looking for that image
from the ROOT web-app because of the / at the start?

I guess the question is, when you might possibly be deploying any given
web-app into a container with other web-apps, is there a specific way to get
to paths via the web-app the path is being used in, and NOT access some
other web-apps?

Worse case...you have web-app A deployed as root (/), then web-app B which
is at /B. They both have folders called /images in them. If web-app B uses
the "/images/" it is infact accessing the web-app A images folder... is this
right?  So I would want all links/images/actions to be relative to the
web-app its deployed on. Can someone explain how to guarantee that?

Thanks.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to