给定一个Servlet的代码片段如下: ( )
A: PrintWriter out = response.getWriter();
B: PrintWriter out =request.getWriter();
C: OutputStream out =response.getOutputStream();
D: OutputStream out =request.getWriter();
A: PrintWriter out = response.getWriter();
B: PrintWriter out =request.getWriter();
C: OutputStream out =response.getOutputStream();
D: OutputStream out =request.getWriter();
举一反三
- 在 Servlet 中,response.getWriter()返回的是________对象 A: JspWriter B: PrintWriter C: Out D: ResponseWriter
- response对象的getOutputStream()和getWriter()方法都可以发送响应消息体,两者可以同时使用
- JSP内置对象有:exception、pageContext、out、config、_____、page、response、request、_____。
- 面那些选项能够创建一个OutputStream流,并且可以将内容附加到“file.txt”文件中 A: OutputStream out=new FileOutputStream(“file.txt“); B: OutputStream out=new FileOutputStream(“file.txt“,”append”); C: OutputStream out=new FileOutputStream(“file.txt“,true); D: OutputStream out=new FileOutputStream(“file.txt“);
- 使用( )对象获取地址栏中的参数 A: out B: response C: session D: request