首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

jsp注销实现有关问题

2012-01-19 
jsp注销实现问题Action :String name request.getParameter(name) //获取登陆用户名称ActionContext.

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>");//回到首页
%>

……

热点排行