日期:2014-05-17  浏览次数:20838 次

jsp注销实现问题
Action :
String name = request.getParameter("name"); //获取登陆用户名称
ActionContext.getContext().getSession().put("nsrname", name);

-----------
<th>欢迎您,</th>
  <td>
  <s:property value="#session.nsrname"/>
  </td>
</tr><tr>
  <th>
  <a href="">注销</a>
  </th>
  </tr>

-------------
这里的注销 怎么实现 谢谢了。

------解决方案--------------------
探讨
<%
if(session.getAttribute("name")!=null)//判断用户名是不是为空
{
session.removeAttribute("name");//注销
}

out.println("<script>alert('您已成功注销登录!');this.location.href='index.jsp';</script>");//回到首页
%>

……