A, ServletContext features
Web engineering is only one ServletContext object (all Servlet get ServletContext object are the same)
Two, ServletContext usage
①, get global configuration parameters
②, acquired Web engineering resources
③, according to their characteristics, data sharing among servlet
Third, verify usage
①, get global configuration parameters
Ⅰ, configuration parameters
Ⅱ, obtain configuration parameters
ServletContext context = getServletContext(); String address=context.getInitParameter("address"); System.out.println(address);
Ⅲ, results