Servlet e Jsp: richiamare una pagina da una servlet

Ecco come faccio per richiamare un link da una servlet:

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

dispatch(request, response, "prova.jsp");

}

Ed ecco il metogo dispatch:

public void dispatch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response, String nextPage)
throws ServletException, IOException {

RequestDispatcher dispatch = request.getRequestDispatcher(nextPage);
dispatch.forward(request, response);

}

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>