Peter wrote:
Hi all, I have many entries in /etc/hosts file, like this

cat /etc/hosts localhost
::1        localhost6.localdomain6 localhost6
a.b.c.d hostname
a.b.c.d hostname

in webapp directory, webapp folders


my tomcat uses port 80, so by default when I enter any of above hostname on
browser I could see default index page, but my interest is like below

if I enter * <>* on browser,
then tomcat should forward it to webapp client1

* <>*
same way if I enter * <> *it
should forward to to

* <>*
How this can be achieved

*I am not interested to use virtual host in tomcat,

The question here would be : why not ?
Because that is the usual (and most "natural") way of doing the kind of thing 
that you want.

Other than virtual hosts, you can do as Chuck suggests, and use a servlet filter in the ROOT webapp to re-direct, but it is almost guaranteed to give you headaches later on, when your pages will contain self-referencing URLs and the like. Or else, it will be very inefficient, because you will have 2 round-trips to the browser for each access.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to