JBoss, a division of Red HatJBoss.org - Community driven.
Printer Friendly Version

JBoss Web Application Deployment Descriptor

Introduction

The jboss-web.xml is an XML file containing the JBossWeb specific behaviour of a webapp. It replaces the Tomcat context.xml file. You need only to use it if you want properties and behaviour that extent the web.xml of the Servlet 3.0 specifications.

Attributes

Common Attributes

The jboss-web.xml supports the following attributes:

AttributeDescription
env-entry

An element env-entry as defined in J2EE

ejb-ref

An element ejb-ref as defined in J2EE

ejb-local-ref

An element ejb-local-ref as defined in J2EE

service-ref

An element service-ref as defined in J2EE

resource-ref

An element resource-ref as defined in J2EE

resource-env-ref

An element resource-env-ref as defined in J2EE

message-destination-ref

An element message-destination-ref as defined in J2EE

persistence-context-ref

An element persistence-context-ref as defined in J2EE

persistence-unit-ref

An element persistence-unit-ref as defined in J2EE

post-construct

An element post-construct as defined in J2EE

pre-destroy

An element pre-destroy as defined in J2EE

data-source

An element data-source as defined in J2EE

context-root

Root context of the web-app. It defaults to the filename of the deployememt without the .war suffix

virtual-host

Name of the virtual-host the application will accept request from.

annotation

Element describing an annotation of the webapp.

listener

Element describing a listener of the webapp.

session-config

Element describing the session-config of the webapp.

valve

Element describing a valve of the webapp.

overlay

name of the overlay to add the webapp

security-domain

Name of the security domain to use for the webapp

security-role

Element describing a security-role of the webapp.

jacc-star-role-allow

NOT YET SUPPORTED: See JBMETA-134

disable-cross-context

Prevent application to call another application context. Default: true

Nested Components

annotation

annotationdescribes how the annotation of the webapp

AttributeDescription
class-name

name of class of the annotation.

servlet-security

servlet-security Element (like @ServletSecurity)

run-as

servlet-security Element (like @RunAs)

multi-part

servlet-security Element (like @MultipartConfig)

listener

listenerdescribes a listener of the webapp.

AttributeDescription
class-name

name of class of the listener.

list of conditionElements. See condition below.

listener-type

Tell what kind of listener to add to the Context of the webapp:

  • CONTAINER: Add a ContainerListener to the Context.

  • LIFECYCLE: Add a LifecycleListener to the Context.

  • SERVLET_INSTANCE: Add a InstanceListener to the Context.

  • SERVLET_CONTAINER: Add a WrapperListener to the Context.

  • SERVLET_LIFECYCLE: Add a WrapperLifecycle to the Context.

module

name of the module containing the listener class.

param

A parameter: param-name and param-name

session-config

session-config describes the session configuration of the web-app that is like the <session-config> of the web.xml. It is here for compatibility

valve

valve describes a valve of the webapp. Similar to the listener has class-name, module and <param/>

security-role

security-role describes a securite role of the web-app that is like the <security-role; of the web.xml. It is here for compatibility