164
If the WAR is packaged into an EAR file, the context-root used is the context specified in the
•
application.xml
If the WAR is standalone, the context-root is the name of the WAR file (that is, the context-root is
•
for
/jadmin
jadmin.war
If the context-root is / or empty, the web application is deployed as ROOT context (that is,
http://localhost:9000/).
java2-delegation-model
If true: the web application context uses a classloader, using the Java 2 delegation model (ask parent
•
classloader first).
If false: the class loader searches inside the web application first, before asking parent class loaders.
•
17.2. Examples of Web Deployment Descriptors
Example of a standard Web Deployment Descriptor (
•
?xml version="1.0" encoding="ISO-8859-1"?
web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4"
servlet
servlet-name Op /servlet-name
servlet-class
org.objectweb.earsample.servlets.ServletOp
/servlet-class
/servlet
servlet-mapping
servlet-name Op /servlet-name
url-pattern /secured/Op /url-pattern
/servlet-mapping
security-constraint
web-resource-collection
web-resource-name Protected Area /web-resource-name
!-- Define the context-relative URL(s) to be protected --
url-pattern /secured/* /url-pattern
!-- If you list http methods, only those methods
are protected --
http-method DELETE /http-method
http-method GET /http-method
http-method POST /http-method
http-method PUT /http-method
/web-resource-collection
auth-constraint
!-- Anyone with one of the listed roles
may access this area --
role-name tomcat /role-name
role-name role1 /role-name
/auth-constraint
/security-constraint
!-- Default login configuration uses BASIC authentication --
Chapter 17. Defining the Web Deployment Descriptor
file.
).
element: Set the compliance to the Java 2 delegation model.
):
web.xml
Need help?
Do you have a question about the APPLICATION SERVER - JONAS and is the answer not in the manual?
Questions and answers