【读书笔记】之《head first Servlet and Jsp》 第五章 属性和监听者

本章大纲

1.servletConfig和servletContext的区别

1.servletConfig和servletContext的区别

  • 从部署位置来看,servletConfig是在servlet中,而servletContext是在web-app下
  • 从代码来说,
    getServletContext().getInitParameter("foo");
    getServletConfig().getInitParameter("foo")
  • 从可用来看,servletConfig只对对应的servlet可用,而servletContext对所有servlet和JSP都有用
Ride the wave as long as it will take you.
原文地址:https://www.cnblogs.com/jianpanaq/p/7207729.html