首先在登陆界面将用户名保存起来,我这里是将用户名提交到Servlet然后再进行保存,
//从登录界面取用户参数
String uname = request.getParameter("userName");
request.getSession().setAttribute("username",uname);//将用户名保存在整个会话期间
然后在需要显示的地方将其获取并进行显示,
<%String username = request.getSession().getAttribute("username").toString();%>
您好,<%=username %>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)