在Servlet中有一段代码如下
publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)
throwsServletException,IOException{
request.setAttribute("name",newInteger(100));
response.sendRedirect("show.jsp");
}
在show.jsp中
<%=request.getAttribute("name")%>
页面结果为
publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)
throwsServletException,IOException{
request.setAttribute("name",newInteger(100));
response.sendRedirect("show.jsp");
}
在show.jsp中
<%=request.getAttribute("name")%>
页面结果为
举一反三
- 在Servlet中有一段代码如下 public void doPost(HttpServletRequestrequest, HttpServletResponse response) throwsServletException, IOException { request.setAttribute("name", new Integer(100)); response.sendRedirect("show.jsp"); } 在show.jsp中 <%=request.getAttribute("name")%> 页面结果为
- 在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中有一段代码为: 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