我看过 servlet 示例,它们是这样的:
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\">");
...
}
我的问题是,我可以返回 HTML 页面而不是代码吗?我的意思是,像这样:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
SHOW(FILE.HTML);
}
谢谢!!!;)