web.xml Visual Editor: General
See Also
You open the web.xml Visual Editor
from the Projects window by
expanding the Web Pages node, then the WEB-INF node, and then double-clicking
the web.xml file. Click General at the top of the editor
to open the General view.
Use the General view to add, remove, and
display the web.xml file's general information.
Overview of the Web Application Deployment Descriptor
Each web application has a deployment descriptor, which is an XML file that describes
how the application should be deployed. The deployment descriptor tells the server
about the components that make up the application. The elements of a deployment
descriptor can include:
- Context Parameters. These define the shared String constants that
are used by the web application. Set these in the Context Parameters section.
- Web Application Listeners. These list the listeners that the web application
uses. Set these in the Web Application Listeners section.
- Servlet Declarations. These list the servlets that the web application
uses and provide initialization parameters. Set these in the Servlets section.
- Servlet Mappings. These tell the servlet container which servlet
to call for a given (context-relative) request URI or for a request URI pattern.
Set these in the Servlets section.
- Filter Declarations. These list the filters that the web application uses.
Set these in the Filters section.
- Filter Mappings. These tell the servlet which filters to invoke for
a servlet. Set these in the Filters section.
- Welcome File List. This list specifies the file to use for the default
welcome file, such as index.html. Set these in the Welcome Files section.
- Error Page Declarations. These declare the JSP and HTML files that
are to be used for handling specified error states and exceptions.
Set these in the Error Pages section.
- JSP Property Groups. These declare a set of properties defined for a group of JSP files within a web application.
Note that this is supported from J2EE 1.4 onwards only.
Set these in the JSP Property Groups section.
- References. These declare logical names for different types of references
used in the web application.
Set these in the Environment Entries section, the
Resource References section,
the Resource Environment References section,
the EJB References section, or the
Message Destination References section.
- Security. These declare the login configuration, security roles, and security constraints for the application.
You can define most of the contents of a web.xml file in the
web.xml Visual Editor. For elements that cannot be defined
in the editor, click XML at the top to view and edit the deployment
descriptor's XML code.
The following general elements of the web.xml file can be defined
in the General section:
- Display Name. Specifies the file's display name, such as Pizza Delivery Application, Version 1.13.
- Description. Specifies a description, such as Deployment information for Version 1.13 of Pizza Delivery Application.
- Distributable. Specifies that all requests that are part of a session
must be handled by one Java Virtual Machine (JVM) at a time. See section 7.7.2 of
the Java Servlet Specification Version 2.4 for details.
- Session Timeout. Specifies the default session timeout interval in seconds
for all sessions created in the current web application. To set the session timeout interval for a
specific session, use the HttpSession.setMaxInactiveInterval(int interval) method.
By definition, if the timeout period for a session is set to -1, the session will never expire.
- See Also
- About Deployment Descriptors
- About Configuring Web Applications
- Configuring Web Application Deployment Descriptors
Legal Notices