Use cases for @WebInitParam

前端 未结 3 947
既然无缘
既然无缘 2021-02-02 14:41

Since the Servlet 3.0 specification there is the possibility of declaring servlet mapping metadata as annotation on the servlet class:

@WebServlet(name=\"appInfo         


        
3条回答
  •  深忆病人
    2021-02-02 14:55

    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
        
      
    

提交回复
热议问题