I have two CNAME-s pointed to the same server. I want to assign one servlet to the first CNAME and another one to the second CNAME. Can I do it in web.xml (or somehow else without manual parsing of ServletRequest)?
I have two CNAME-s pointed to the same server. I want to assign one
Share
One of the idea to have a filter, and in it have a condition based on
ServletRequest#getServerName()and dispatch the request to appropriate servlet, will do.obviously, you could have
<init-param>in yourweb.xmlto dynamically set the domains, so that you could change these values based on your build profile.