Middle
What is a deployment descriptor?
sobes.tech AI
Answer from AI
A deployment descriptor is an XML file used in Java EE (Jakarta EE) to configure the deployment of web applications, EJB modules, enterprise applications (EAR), and other components. It describes how application components should be deployed and initialized on the application server.
Main deployment descriptor files:
web.xml: For web applications (WAR). Defines servlets, filters, listeners, initialization parameters, URL mappings to components, error pages, and other settings.ejb-jar.xml: For EJB modules (EJB JAR). Configures EJB components, their types (Session, Message-Driven), transactional attributes, security, and resource references.application.xml: For enterprise applications (EAR). Defines modules included in the EAR (WAR, EJB JAR, Client JAR), their load order, and other common settings.
In modern versions of Java EE (Jakarta EE), many settings that previously required explicit declaration in descriptors can be defined using annotations in the source code. However, deployment descriptors are still useful for overriding annotation-defined settings or for configuring server-specific parameters.