在test.jsp页面中:<a href="TestServlet?id=6">This is a test page</a>TestServlet类中的doGet方法中:
int id=Integer.valueOf(request.getParameter("id"));
  if(id==6)
  {
   request.setAttribute("id", id);
              request.getRequestDispatcher("index.jsp").forward(request, response);
  }
  else
   response.sendRedirect("Error.jsp");}index.jsp页面中:
<body>
  <%  String id=request.getAttribute("id").toString();
      if(id==null){
  %>
  <h1><%=id %></h1>
  <%
      }
  %>
</body>
为什么id是空的?页面传值失败!这是为什么?