3

Wildfly セットアップ内に複数の仮想ホストがありますが、それらにカスタム サーブレット コンテナを使用させることができず、代わりにすべてデフォルトのものを使用しています。セッション Cookie をカスタマイズして、さまざまなサイトが他のサイトのセッションを壊すことなくそれぞれのポートで動作するようにするために、特にこれを行う必要があります。

スタンドアロン.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>

それぞれの jboss-web.xml ファイルには以下が含まれます。

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

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

サーバータグの servlet-container 属性を指定しても、jboss-web.xml 内で servlet-container タグを指定しても効果がないようで、デフォルトのサーブレットコンテナーが常に使用されます。

足りないものはありますか?それとも、サーブレットコンテナがデフォルト以外になるのを妨げているどこかにバグがありますか?

4

0 に答える 0