Since the Servlet 3.0 specification there is the possibility of declaring servlet mapping metadata as annotation on the servlet class:
@WebServlet(name=\"appInfo
The annotations are used to give the default values.
In JavaEE the deployment properties can also be provided using annotations. Given the values for annotations, the deployment descriptor i.e, web.xml can still be used to override the default values provided by the annotations.
In the example above, the init-param
can be overriden by configuring a servlet
with a matching name in web.xml
:
appInfoServlet
ocwd.deployer.email
noreply@example.com