ServletContext.getRequestDispatcher()でIllegalArgumentExceptionが発生することがあります。
具体的なエラーとしては、
ServletContext.getRequestDispatcher()メソッドで与えるパスは絶対パスである必要があります。そのため以下のコードはエラーとなります。
rd = context.getRequestDispatcher("./index.jsp");
rd.forward(req,res);
エラーを回避するには次のように絶対パスで指定します。
rd = context.getRequestDispatcher("/index.jsp");
rd.forward(req,res);