init(ServletConfig)メソッドのリストにinitパラメーター名を追加しようとしています。
public void init(ServletConfig sc){
try {
super.init(sc);
Enumeration<String> e= sc.getInitParameterNames();
while(e.hasMoreElements()){
list.add(e.nextElement());
}
} catch (ServletException e1) {
e1.printStackTrace();
}
}
e.hasMoreElement()がfalseを返すため、このリストを使用するとNullPointerExceptionが発生します。web.xmlファイルにinitパラメーターを正しく追加したと確信しています。何が問題になっていますか?ご意見をお聞かせください。