阅读下面Servlet1类中的代码片段
举一反三
- 阅读下面代码片段: Servlet1: response.getWriter().write(“hello,servlet1”); request.getRequestDispatcher().include(“Servlet2”); Servlet2: response.setHeader(“Refresh”,”1”); response.getWriter().write(“,servlet2”);
- 阅读下面Servlet1类中的代码片段: Servlet1: response.getOutputStream().write("传智".getBytes("gbk")); response.getWriter().write("播客"); request.getRequestDispatcher("/Servlet2").forward(request,response); 如果使用浏览器访问Servlet1时会有什么结果( )
- 阅读下面代码片段: Servlet1: response.setContentType("text/html;charset=gbk"); response.getWriter().write("传播智慧"); request.getRequestDispatcher("/servlet/Servlet2") .forward(request,response); response.sendRedirect("/app/servlet/Servlet3"); Servlet2: response.getWriter().write("收获成长"); 请问当浏览器访问Servlet1时会有什么样的输出
- 阅读下面代码片段:Servlet1:response.getWriter().write(“hello,servlet1”);request.getRequestDispatcher().include(“Servlet2”);Servlet2:response.setHeader(“Refresh”,”1”);response.getWriter().write(“,servlet2”); A: 正常显示:hello,servlet1,servlet2 B: 正常显示:hello,servlet1,servlet2,并且页面会不断刷新 C: 正常显示:,servlet2 D: 正常显示:hello,servlet1
- 阅读下面代码片段[img=525x134]17e0acea8796010.png[/img]下面选项中,关于运行结果说法正确的是() A: 正常显示:hello,servlet1,servlet2 B: 正常显示:hello,servlet1,servlet2,并且页面会不断刷新 C: 正常显示:,servlet2 D: 正常显示:hello,servlet1