session什么意思啊 如何让servlet输出内容到指定页?

如何让servlet输出内容到指定页?将查询到的数据保存为servlet中的session,然后在页面中显示;servlet代码:String username=请求.getParameter(“us

如何让servlet输出内容到指定页?

将查询到的数据保存为servlet中的session,然后在页面中显示;servlet代码:String username=请求.getParameter(“username”)字符串密码=请求.getParameter(“password”)如果(用户名!=空密码(&P)!=null){HttpSession会话=请求.getSession() 会话.setAttribute(“uname”,用户名)会话.setAttribute(“pword”,密码)}响应.sendRedirect(" 索引.jsp") 索引.jsp显示页面:XML/HTML代码