Java中获取ServletContext的方法

Servlet:

this.getServletContext()
this.getServletConfig().getServletContext()
request.getSession().getServletContext()

JSP:

request.getSession().getServletContext()

Filter:

config.getServletContext()

 

posted @ 2017-03-17 01:50  EasonJim  阅读(2180)  评论(0编辑  收藏  举报