tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Getting Tomcat server to discriminate between domains
Date Sat, 08 Mar 2008 05:19:28 GMT
> From: [] 
> Subject: Getting Tomcat server to discriminate between domains 
> In other words, I want people accessing my web site through 
> my IP address (rather than through the domain name) to always 
> end up on a certain web page (application K) which I serve locally.

Create another <Host> element in server.xml with the attribute
name="" and an appBase attribute pointing to some directory
other than the default <Host>'s appBase (typically webapps).  For
testing, I used "altWebapps", so that's what will appear in the

Place your application K in altWebapps/ROOT; create a web.xml in
altWebapps/ROOT/WEB-INF with a servlet mapping url-pattern of "/*" for
the app's one and only servlet.  Code that servlet to display whatever
you want to chide your users into using the correct URL and put its
class file in altWebapps/ROOT/WEB-INF/classes.  Note that all of the
above is case-sensitive, regardless of platform.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message