Tag Archives: ServletContext

web.xml中<context-param>与<init-param>的差别及各自的读取方式

使用ServletContext.getInitParameter()方法 可以获得web.xml中的参数 – 使用范围很广, 能getServletContext就可以使用.

在Servlet的init()函数中使用this.getInitParameter()获得web.xml的参数 – 较为局限的参数. 注意逻辑上的层次划分

Posted in Java | Tagged , , , , | Leave a comment