在Servlet中有一段代码如下 publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ request.setAttribute("name",newInteger(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")%> 页面结果为
中国大学MOOC:publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{request.getSession().getAttribute(“A”);//第二行}假定第二行返回的对象引用不是null,那么这个对象存储在()范围中。
中国大学MOOC:publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{request.getSession().getAttribute(“A”);//第二行}假定第二行返回的对象引用不是null,那么这个对象存储在()范围中。
在J2EE中,给定某Servlet的代码如下,编译运行该文件,以下陈述正确的是 PublicclassServlet1extendsHttpServlet{ Publicvoidinit()throwsServletException{ } Publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse) ThrowsServletException,IOException{ PrintWriterout=response.getWriter(); out.println(“hello!”); }}
在J2EE中,给定某Servlet的代码如下,编译运行该文件,以下陈述正确的是 PublicclassServlet1extendsHttpServlet{ Publicvoidinit()throwsServletException{ } Publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse) ThrowsServletException,IOException{ PrintWriterout=response.getWriter(); out.println(“hello!”); }}
1