You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mailtracker <ma...@mac.com> on 2001/08/20 22:35:27 UTC

URL mapping: /appname/stuff/login.jsp --> /appname/login.jsp ?

-------------------

Tomcat 3.2.x
Apache 1.3.20
Solaris 2.8 (aka 8)
Sun JDK1.3.1

We are moving a large, servlet-like Java thing toward compliance with the
Servlet spec version 2.2.  One issue, considered by some to be a real
problem, is that in the migration our URL has changed from
.../appname/login.jsp to ../appname/stuff/login.jsp

We're looking for the magic Tomcat and Apache directives that will allow a
web client to type in "http://[hostname]/appname/login.jsp", as they have in
past versions, and receive in response
.../tomcat/webapps/appname/stuff/login.jsp

-------------------

(now saying the same thing in another way...)

So we're locked into this structure:

tomcat/..

../webapps/appname/
../......./......./[directory]/
../......./......./.........../
../......./......./stuff/         (includes index.htm, login.jsp, and so on)
../......./......./WEB-INF/
../......./......./......./lib/

Tomcat's default behaviour is to serve this web application as:
http://[hostname]:8080/appname/stuff/login.jsp

We'd like for Tomcat and Apache, when the two are hooked together, to serve
the content as:

http://[hostname]/appname/login.jsp

-------------------

any suggestions appreciated!




Re: URL mapping: /appname/stuff/login.jsp --> /appname/login.jsp ?

Posted by Denis Haskin <De...@HaskinFerguson.net>.
You're 'locked in' to the structure you describe only if you use the 
default webapp context.  Instead, create your own context(s).

Create a new context in $TOMCAT_HOME/conf/server.xml:

        <Context path="/Appname"
                 docBase="/usr/appname"
            ...other attributes omitted...
        </Context>

and then at /usr/appname you would have a hierarchy like this:

/usr/appname
    login.jsp
    WEB-INF/
        web.xml
        classes/
        ...etc...

Then to get to login.jsp the url would be 
http://[hostname]/Appname/login.jsp, as you want.

See the servlet spec documents (I know, can be hard to read), the 
application development manual at 
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/index.html (although as 
it says itself, it's somewhat out of date).

dwh


mailtracker wrote:

>-------------------
>
>Tomcat 3.2.x
>Apache 1.3.20
>Solaris 2.8 (aka 8)
>Sun JDK1.3.1
>
>We are moving a large, servlet-like Java thing toward compliance with the
>Servlet spec version 2.2.  One issue, considered by some to be a real
>problem, is that in the migration our URL has changed from
>.../appname/login.jsp to ../appname/stuff/login.jsp
>
>We're looking for the magic Tomcat and Apache directives that will allow a
>web client to type in "http://[hostname]/appname/login.jsp", as they have in
>past versions, and receive in response
>.../tomcat/webapps/appname/stuff/login.jsp
>
>-------------------
>
>(now saying the same thing in another way...)
>
>So we're locked into this structure:
>
>tomcat/..
>
>../webapps/appname/
>../......./......./[directory]/
>../......./......./.........../
>../......./......./stuff/         (includes index.htm, login.jsp, and so on)
>../......./......./WEB-INF/
>../......./......./......./lib/
>
>Tomcat's default behaviour is to serve this web application as:
>http://[hostname]:8080/appname/stuff/login.jsp
>
>We'd like for Tomcat and Apache, when the two are hooked together, to serve
>the content as:
>
>http://[hostname]/appname/login.jsp
>
>-------------------
>
>any suggestions appreciated!
>
>
>
>