The web.xml file is used to configure the following:
- Servlets and JSP registration
- Servlet initialization parameters
- JSP tag libraries
- MIME type mappings
- Welcome file list
- Error pages
- Security constraints and roles
- Resources
- EJB references
ex:
<?xml version='1.0'
encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servlet>
<servlet-name>Benefits</servlet-name>
<servlet-class>com.dizzyworld.BenefitsServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Benefits</servlet-name>
<url-pattern>/servlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>welcome.html</welcome-file>
</welcome-file-list>
</web-app>
weblogic.xml
The weblogic.xml deployment descriptor follows a
WebLogic-specific schema that is used only by Oracle WebLogic Server. It allows
you to enable and configure Web application features that are not part of the
Java EE specification. For example:
•Change the default root URL path of
the Web application
•Direct application log messages to
a dedicated log file
•Change the default HTTP session
timeout
•Change the default cookie name that
is used to track HTTP sessions
•Enable clustering features, such as
in-memory replication and persistence
•Assign a WebLogic work manager to
process requests to this application. Work managers are used to assign relative
CPU time to high or low priority applications for tuning and fairness purposes.
•Tune the threading behavior that is
used to process requests to this application
•Map other file system locations to
URLs for this Web application
•Enable JSP precompilation
•Enable directory index pages
•Enable dynamic reloading of classes
•Set the default MIME type
<weblogic-web-app>
<context-root>/</context-root>
</weblogic-web-app>
<context-root>/</context-root>
</weblogic-web-app>
weblogic-application.xml
The weblogic-application.xml file is the Oracle WebLogic
Server–specific deployment descriptor extension for the standard Java EE application.xml deployment descriptor. It allows
you to enable and configure features such as:
•Referencing a shared library module
that is deployed outside of this application
•Assigning a WebLogic work manager
to process requests to the application modules
•Tuning the threading behavior used
to process requests to the application modules
•Changing the default HTTP session
timeout for all Web application modules
•Changing the default cookie name
that is used to track HTTP sessions for all Web application modules
•Enabling clustering features such
as in-memory replication and persistence for all Web application modules
•Configuring an applicationwide EJB cache (as opposed to an enterprisewide specification)