init()方法里的这三个,有什么区别?this.getServletConfig().getInitParameter("username")+"----"+this.getServletContext().getInitParameter("username")+"----"+ this.getInitParameter("username")
public class MyFirestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("get方法执行");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("post方法执行");
}
@Override
public void init() throws ServletException {
System.out.println(this.getServletConfig().getInitParameter("username")+"----"+this.getServletContext().getInitParameter("username")+"----"+ this.getInitParameter("username"));
}
}