阅读下面代码片段:RequestDispatcher dispatcher=re...d(request,response);
举一反三
- 阅读下面代码片段:RequestDispatcher dispatcher=request.getRequestDispatcher("a.jsp");dispatcher.forward(request,response);
- RequestDispatcher dispatcher=request.getRequestDispatcher("a.jsp"); dispatcher.forward(request,response); 关于该段代码的作用,下列叙述哪项是正确的?
- 智慧职教: 在Servlet中有如下代码段: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dis; _____________________________; dis.forward(request,response); }
- 阅读下面代码片段: 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,两者输出情况的描述正确的是( )。
- 请求转发的forward(request,response)方法是以下哪个对象提供的? A: request对象 B: response对象 C: RequestDispatcher 对象 D: session对象