3

I have multiple virtual hosts within my Wildfly setup, but I'm unable to get them to use a custom servlet container and they instead all use the default one. I specifically need to do this to customise the session-cookie so that the various sites work on their respective ports without clobbering the others' 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 respective 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 servlet-container attribute of the server tag, nor specifying the servlet-container tag within jboss-web.xml seem to have any effect, and the default servlet container is always used.

Is there something I'm missing? Or is there a bug somewhere where that is preventing the servlet container from being anything but the default?

0 Answers0