题目内容

在Servlet中,HttpServletResponse的( )方法用来把一个HTTP请求重定向到另外的URL。

A. sendURL()
B. redirectURL()
C. sendRedirect()
D. redirectResponse()

查看答案
更多问题

给定一个Servlet的代码片段如下:public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{_____________________out.println("hi kitty!");out.close();}运行该Servlet时输出“hi kitty!”,则应在此Servlet的下画线处填入的代码是( )

A. PrintWriter out =response.getWriter();
B. PrintWriter out =request.getWriter();
C. OutputStream out=response.getOutputStream();
D. OutputStream out=request.getWriter();

给定一个Servlet程序的代码片段如下:Public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException{request.getSession().getAttribute("A");}假定第2行返回的对象引用不是null,那么这个对象存储在( )范围中。

A. page
B. session
C. request
D. application

在web.xml 中定义了一下内容:Goodbyecc.openhome.LogutServletGoodBye/goodbye下列可以正确访问该Servlet URL的是( )

A. /goodbye.servlet
B. /LoguotServlet
C. /Goodbye
D. /goodbye

The primary purpose of the passage is to _________.

A. illustrate different views about advantages and disadvantages of gender diversity
B. emphasize the importance of gender diversity for firms
C. illustrate the practical value of gender diversity from different dimensions
D. encourage people to respect gender diversity

答案查题题库