-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

(Let's try this again.)

On 7/21/2010 11:13 AM, john.rana...@thomsonreuters.com wrote:
> > Our application has a Context Root of "DealsWeb". I need to be able to
> > map a different root path to this web application.
I feel like we just covered this in the last 24 hours or so. I can't
seem to find the thread, though.

> > For example:
> >
> > This:
> >
> > http://server.com/NASApp/DealSearch/DoSomethingServlet
> >
> > Needs to map to this:
> >
> > http://server.com/DealsWeb/DoSomethingServlet
> >
> > I know how to use path mappings in one application but not across.
How do you do it in a single application? If you use <servlet-mapping>,
then you're right: you can't map across webapps.

You can set up a fictional context, say, NASApp, that contains nothing
but redirects to the real app. You can use
http://www.tuckey.org/urlrewrite/ to map URL spaces from one to another.

Maybe something like this:

<rule>
  <from>/DealSearch/(.*)</from>
  <to type="redirect">/DealsWeb/$1</to>
</rule>

Note that the "NASApp" isn't mentioned because it's the context name. If
you have multiple contexts to map in this way, you could set up one
webapp/context for each of them, as above, or you could deploy a ROOT
webapp that intercepts them all. In that case, you'd need:

<rule>
  <from>/NASApp/DealSearch/(.*)</from>
  <to type="redirect">/DealsWeb/$1</to>
</rule>
<rule>
  <from>/SomeOtherName/DealSearch/(.*)</from>
  <to type="redirect">/DealsWeb/$1</to>
</rule>

etc.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxHPQ8ACgkQ9CaO5/Lv0PAUPwCgtZ17sNvrNvucm/sSGZg1exhj
rm4AoJVFu5qIvgy8kHaLwpYRzW+PiywT
=Q/kD
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to