Look at the Host header to see how the browser addressed your webserver and then you can specialize your output.

theHostString = theHttpServletRequest.getHeader("Host");

if (theHostString != null && theHostString.trim().length > ) {
if (theHostString.startsWith("sub1.")) {
doSub1Content(...);
} else if (...) {
} else {
// unknown subdomain
sendDefaultContent(...);
}
} else {
// someone possible spoofing the host header or HTTP 1.0 which I don't believe had the host header
sendDefaultContent(...);
}

greg

On Mar 5, 2008, at 12:52 PM, GF wrote:

Hello,
I have a web application that runs on:

www.myhost.com/myapp/

I would like that the deploy a single .war can handle all the requests such as:

sub1.myhost.com/myapp/
sub2.myhost.com/myapp/
sub3.myhost.com/myapp/

And of course i want to receive the parameter on which subdomains the
request has been executed.
Is it possible? Have you any good link about this?

This can be done at Tomcat level.. or should I handle it with
mod_rewrite in Apache and then passing the request to a single path of
 Tomcat using mod_jk?

Thank you!

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to