servlet问题2

来源:百度知道 编辑:UC知道 时间:2024/05/24 08:28:35
you want the copyright information contained in /html/copyright.html to be added to the html content that your servlet generates. Which of the following code fragments occurring in the doGet() method would achieve this objective?

请问这句话为什么不对?
this.getServletContext().getRequestDispatcher("/html/copyright.html").forward(request,response);
谢谢!

相对路径,绝对路径的问题。
你配置了2个同样的路径! web。xml

看看

是 request.getRequestDispatcher("/html/copyright.html").forward(request,response);
吧。
你说的那个我没用过。