题目内容

JSP的内置对象中,按作用域由小到大的排列是?:

A. page->request->application
B. request->page->response
C. response->request->application
D. session->application->page

查看答案
更多问题

已知表单有一个参数名为“userName”的参数,提交后,能够正确获得表单对象值的代码是:

A. request.getParameter(“userName”);
B. response.getParameter(“userName”);
C. request.getParameter(“username”);
D. request.getParameterValues(“userName”);

JSP内置对象request的getParameterValues()方法返回值是:

A. String[]
B. Object[]
C. String
D. Object

下列不能够将页面跳转到a.jsp的是:

A. response.sendRedirect(“a.jsp”);
B. request.getRequestDispatcher("a.jsp").forward(request,response);
C. request.setAttribute(“a”,”a.jsp”);
D. response.setHeader("refresh","2;URL=a.jsp");

在Servlet里,能正确获取application的语句是:

A. ServletContextapplication=(ServletContext)session.getServletContext();
B. ServletContextapplication=(ServletContext)request.getServletContext();
C. ServletContextapplication=(ServletContext)session.getServletContext(true);
D. ServletContextapplication=(ServletContext)response.getServletContext();

答案查题题库