users@glassfish.java.net

Re: Multiple war's mapped to different ports

From: <Jan.Luehe_at_Sun.COM>
Date: Mon, 23 Jul 2007 14:31:36 -0700

glassfish_at_javadesktop.org wrote:

>Thanks for your reply. I'm already doing something like what you are suggesting.
>
>However, I need http://www.example.com/ to map to one war, and https://www.example.com/ to map to the other. This would be easy if the two war's were in different ear's, but in this case they are in the same.
>
>Is this even possible at all in Glassfish?
>
>

Normally, if you want 2 WARs to be accessible at "www.example.com", but via
*different* listeners, you would configure the following setup:

  <http-listener id="l1" port="1234"/>
  <http-listener id="l2" port="5678"/>
  <virtual-server hosts="www.example.com" http-listeners="l1" id="vs1"/>
  <virtual-server hosts="www.example.com" http-listeners="l2" id="vs2"/>

and deploy one WAR to "vs1" and the other to "vs2". Both deployments
would be at "/" (i.e., the virtual server's root context).

However, since both of your WARs are bundled in the same EAR, you cannot
deploy them to distinct virtual servers, so I don't think your use case
is supported.



Jan