String userName = request.getParameter("username");String passWord = request.getParameter("password");if(userName!= null &&session.setAttribute("uname",userName);passWord);
如何让servlet输出内容到指定页?
在servlet中将查询到的数据保存为session,然后再页面中显示即可;servlet代码:String userName = request.getParameter("username");String passWord = request.getParameter("password");if(userName != null && passWord != null){HttpSession session = request.getSession();session.setAttribute("uname", userName);session.setAttribute("pword", passWord);}response.sendRedirect("index.jsp");index.jsp显示页面:XML/HTML code
0