题目:阅读下面代码片段: Servlet1: request.setAttribute("name", "zhangsan"); RequestDispatcher dispatcher = request.getRequestDispatcher("/ResultServlet"); dispatcher.forward(request, response); response.getWriter().write("over"); Servlet2: response.setContentType("text/html;charset=utf-8"); String name = (String) request.getAttribute("name "); response.getWriter().println("名称:" + name); 先使用浏览器访问Servlet1,然后将Servlet1中的forward()方法更改为include()方法再次访问Servlet1,两者输出情况的描述正确的是( )
A. 两种方法下页面输出结果相同,都是”名称:zhangsan”
B. forward()方法输出结果为”名称:zhangsan”;而用include方法输出结果为”名称:zhangsan over”
C. forward()方法输出结果为”名称:zhangsan over”;而用include方法输出结果为”名称:zhangsan”
D. 将forward()方法改为include方法后,页面访问程序出现异常
答案:评论后可见此内容