Monday, February 20, 2012

Why getRequestDispatcher("/index.jsp”).forward() dont work with JSP?


I try to redirect my page to another using request.getRequestDispatcher("/index.jsp").forward(request, response); . But it dont work. Why? But when I change it to response.sendRedirect it work fine.


1 comment:

  1. I think the problem might be because of not using relative url.

    You can try like this

    request.getRequestDispatcher("index.jsp").forward(request, response);

    ReplyDelete