Overriding the default servlet container in Wildfly 8

I have multiple virtual hosts in my Wildfly setup, but I cannot get them to use a custom servlet container and they use the default instead. I specifically have to do this in order to set up a session cookie so that various sites work on their ports without collecting other sessions.

standalone.xml:

<subsystem xmlns="urn:jboss:domain:undertow:1.2">
    <server name="default-server">
        <http-listener name="default" socket-binding="http"/>
        <host name="default-host" alias="localhost">
            <location name="/" handler="welcome-content"/>
        </host>
    </server>
    <server name="server1" servlet-container="servlet-container1">
        <http-listener name="listener1" socket-binding="http1"/>
        <host name="host1" alias="localhost">
            <location name="/" handler="welcome-content" />
        </host>
    </server>
    <server name="server2" servlet-container="servlet-container2">
        <http-listener name="listener2" socket-binding="http2"/>
        <host name="host2" alias="localhost">
            <location name="/" handler="welcome-content"/>
        </host>
    </server>
    ...
    <servlet-container name="default">
        <jsp-config/>
    </servlet-container>
    <servlet-container name="servlet-container1">
        <jsp-config/>
        <session-cookie name="MYSESSION1"/>
    </servlet-container>
    <servlet-container name="servlet-container2">
        <jsp-config/>
        <session-cookie name="MYSESSION2"/>
    </servlet-container>
    ...
</subsystem>

      

The corresponding jboss-web.xml files have the following:

<server-instance>server1</server-instance> 
<virtual-host>host1</virtual-host>
<servlet-container>servlet-container1</servlet-container>

      

and

<server-instance>server2</server-instance> 
<virtual-host>host2</virtual-host>
<servlet-container>servlet-container2</servlet-container>

      

Neither specifying the server tag servlet container attribute nor specifying the servlet container tag in jboss-web.xml seem to have any effect, and the default servlet container is always used.

Is there something I am missing? Or is there a bug somewhere where this prevents the servlet container from being anything other than the default?

+3


source to share





All Articles