• 2021-04-14
    在Servlet中有一段代码如下
    publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)
    throwsServletException,IOException{
    request.setAttribute("name",newInteger(100));
    response.sendRedirect("show.jsp");
    }
    在show.jsp中
    <%=request.getAttribute("name")%>
    页面结果为
  • 举一反三