0

我以这种方式完成了重定向:response.sendRedirect("/"); 为了避免返回浏览器和重定向,我想使用:

request.getRequestDispatcher("/").forward(request, response);

问题是,通常我们将 jsp 的名称放在 getRequestDispatcher 中,在这种情况下我有 NullPointerException。如何使用 url 实现相同的行为?

4

0 回答 0