举一反三
- 在Servlet中有一段代码如下 public void doPost(HttpServletRequestrequest, HttpServletResponse response)throwsServletException, IOException { request.setAttribute("name", new Integer(100)); response.sendRedirect("show.jsp"); } 在show.jsp中 页面结果为( ) A: 100 B: java.lang.Intege C: Intege D:
- 在Servlet中有一段代码如下 public void doPostthrows ServletException,IOException{ request.setAttribute(name,new Integer(100)); response.sendRedirect(show.jsp);} 在show.jsp中 <%=request.getAttribute(name )%>页面结果为()
- 在Servlet中有一段代码如下 publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ request.setAttribute("name",newInteger(100)); response.sendRedirect("show.jsp"); } 在show.jsp中 <%=request.getAttribute("name")%> 页面结果为
- 在Servlet中有一段代码为: public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { request.setAttribute('y', new Integer(100)); response.sendRedirect('show.jsp'); }在show.jsp中<%=request.getAttribute('y')%>页面结果为 ( )。 A: Integer B: java.lang.Integer C: 是null D: 100
- 在Servlet中有一段代码为: public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { request.setAttribute('y', new Integer(100)); response.sendRedirect('show.jsp'); }在show.jsp中;页面结果为 ( )。 A: java.lang.Integer B: 是null C: 100 D: Integer
内容
- 0
在Servlet中有一段代码如下 public void doPost(HttpServletRequestrequest, HttpServletResponse response) throwsServletException, IOException { request.setAttribute("name
- 1
智慧职教: 在Servlet中有如下代码段: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dis; _____________________________; dis.forward(request,response); }
- 2
给定如下所示的Java Servlet代码片段,用户在浏览器地址栏中键入正确的请求URL并回车后,在控制台上显示的结果是()。 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ System.out.println(“get”); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ System.out.println(“post”); } protected void service(HttpServletRequest req, HttpSergvletResponse resp) throws ServletException, IOException{ System.out.println(“service”); }
- 3
给定一个Servlet程序的代码片段如下:Public void doPost(HttpServletRequest request,HttpServletResponse response) throw ServletException,IOException{Request.getSession().getAttribute(“A”); //第2行}假定第2行返回的对象引用不是null,那么这个对象存储在()范围中。 A: page B: application C: request D: session
- 4
中国大学MOOC: 给定某Servlet程序的片段如下,用户在浏览器地址栏中键盘键入正确的请求URL并回车后,在控制台上显示的结果是( )。 public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException ,IOException{ System.out.println(get); } public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException ,IOException { System.out.println(post); }