I've seen servlets examples, they're something like this:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
...
}
My question is, instead of the code, can I return an HTML page? I mean, something like this:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
SHOW(FILE.HTML);
}
Thanks!!! ;)
RequestDispatcherand forward the request. Search around on the site forservlet forward to jspor look on our servlet wiki page.[servlets]tag which you put on the question until a black box shows up and then click therein the info link. Other tags (may) have similar wiki pages.