Hi all,
I am still confused on an issue with relative and absolute paths when
dealing with Servlet 2.2 .war paths. For example, in one applicatoin I
deploy only a single web-app, and in my paths, such as <a
href="/path/page.jsp"> I know this is a relative path to the root web-app.
However, when two or more apps are deployed, I have noticed that if I don't
specify the specific context of the web-app, things get a little messed up.
Assume I deploy two apps, AppA, and AppB. Both apps I have the web.xml mapp
the extension .do to a specific controller servlet. I am following the MVC
architecture where by all requests to the .do extension get sent to the
ControllerServlet, which then (by using a framework like Struts) calls upon
an action class, then forwards to a JSP page. So, in either app, if I use
links such as <a href="/path/page.jsp"> it seems to get confused..how I am
not sure. If I use <a href="<%= contextPath %>/path/page.jsp"> where
contextPath is set to the app context name (for example, AppA/path/page.jsp)
it seems to work alright.
There is one particular problem that may be the culprit but I am not sure. I
have a need to use 3 different web-apps (specifically to guarantee that each
app has its own memory so no cross-talk can occur) but all 3 point to the
same one war folder. This is because we have three identical sites in
functionality, but are different in one way, the particular media type the
user is logged in to. We do store a mediatype value for each user, but we
used to get some cross-talk when they went from one media type to another,
and I think it was mostly related to browser caching problems and the back
button issue.
So I am not sure if this is the problem or not, and the only thing I can
think of is to always append the mediatype to every link and form url being
submitted, such as using url rewriting.
Anyways..if anyone can shed light on the how tos of multiple web-app
deployments in the same server, possibly with 2 or more pointing to the same
www structure, I sure would appreciate being set straight on this.
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