为什么我获得是空值,求解
确实需要注意加上引号,谢谢各位提醒:
this.setUsername(this.getInitParameter("username"));
this.setPassword(this.getInitParameter("password"));
public void init() throws ServletException {
super.init();//需要加上这条语句就好啦
this.setUsername(this.getInitParameter("username"));
this.setPassword(this.getInitParameter("password"));
}
加了啊
public void init() throws ServletException {
this.setUsername(this.getInitParameter("username"));
this.setPassword(this.getInitParameter("password"));
是不是username和password没有加双引号啊
你是不是同时用了config的初始化?