jboss-web.xml 配置说明

        在JBoss 下web工程,为了使用容器提供的一些特性,需要使用jboss-web.xml进行配置。以下是一个配置好的jboss-web.xml示例。

 

Xml代码
 <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN"   
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">  
<jboss-web>  
  
    <!-- For load class independently -->  
    <class-loading java2ClassLoadingCompliance='true'>  
        <loader-repository>  
            com.example:archive=unique-archive-name   
            <loader-repository-config>  
                java2ParentDelegaton=true  
           </loader-repository-config>  
        </loader-repository>  
    </class-loading>  
  
    <!-- For context -->  
    <context-root>test</context-root>  
  
    <!-- For session copy -->  
    <replication-config>  
        <cache-name>standard-session-cache</cache-name>  
    </replication-config>  
  
    <!-- For session time -->  
    <max-active-sessions>20</max-active-sessions>  
    <passivation-config>  
        <use-session-passivation>true</use-session-passivation>  
        <passivation-min-idle-time>60</passivation-min-idle-time>  
        <passivation-max-idle-time>600</passivation-max-idle-time>  
    </passivation-config>  
  
</jboss-web>  

 
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>

	<!-- For load class independently -->
	<class-loading java2ClassLoadingCompliance='true'>
		<loader-repository>
			com.example:archive=unique-archive-name
			<loader-repository-config>
				java2ParentDelegaton=true
           </loader-repository-config>
		</loader-repository>
	</class-loading>

	<!-- For context -->
	<context-root>test</context-root>

	<!-- For session copy -->
	<replication-config>
		<cache-name>standard-session-cache</cache-name>
	</replication-config>

	<!-- For session time -->
	<max-active-sessions>20</max-active-sessions>
	<passivation-config>
		<use-session-passivation>true</use-session-passivation>
		<passivation-min-idle-time>60</passivation-min-idle-time>
		<passivation-max-idle-time>600</passivation-max-idle-time>
	</passivation-config>

</jboss-web>

 

<class-loading> 用来配置JBoss的class loader,避免class加载冲突。

<context-root> 配置网站实际使用目录

<replication-config> 用来设定集群session复制功能。

<max-active-sessions><passivation-config>用来设定集群session激活控制。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐