jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: New API ServletContext#addVirtualHostName

From: Rémy Maucherat <rmaucher_at_redhat.com>
Date: Tue, 26 Feb 2013 09:47:07 +0100

On 02/26/2013 02:59 AM, Greg Wilkins wrote:
> Shing,
>
> Contexts often have multiple virtual names, so I think this method
> should have a multi-valued varient:
>
> Collection<String> getVirtualHostNames();
>
> I think the single valued one is also good as typically there is one
> prime name and several aliases.
I was about to send a comment that the proposed API should probably
return the main name of the vhost (by opposition to the aliases).
Another alternative is to return the content of the host header (but I'm
not convinced this is really useful, after all the header is available
already). So this should be clarified.

The main question about that collection API is if there is a benefit for
the webapp to know all the aliases for its vhost ? (and then the webapp
won't know the "main" name of the vhost)

Rémy