I've noticed an inconsistency in how URLs are used within the servlet engine
in Orion. Perhaps I've never had to deal with this since this is the first
servlet engine I've used that supports .war files, server.xml, web.xml
files, etc.

I have a web app that is deployed like this:

server.xml contains this line:
   <application name="i3" path="../i3"/>

default-web-site.xml contains this line:
   <web-app application="i3" name="i3-web" root="/i3"/>

application.xml contains these lines:
   </module>
      <web>
         <web-uri>i3-web</web-uri>
         <context-root>/</context-root>
      </web>
   </module>

I expect that absolute URLs used anywhere in my JSPs (and that includes <a
href="..">, <%@ include file="..." %>, and response.sendRedirect() calls)
would look like this /i3/<rest of URL>. However, I've noticed that for
anything other than <a href="..."> tags, the /i3 is implied and all I need
is /<rest of URL> for absolute paths.

I have two questions:
1. What does the context-root element do? The servlet and JSP specs are
pretty vague about this.

2. Should I be calling request.getContextPath() and using it to create
absolute URLs for <a href="..."> tags or just try and use relative URLs
within the <a href="..."> tags?

Kurt in Atlanta

Reply via email to