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>-------------
这里的注销 怎么实现 谢谢了。
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>-------------
这里的注销 怎么实现 谢谢了。
解决方案 »
- 我下载了mysql驱动包,想连接javaweb,但驱动包是个压缩包,没有jar文件,
- 回应:驳-----问题越来越没含金量的贴子->limitclear这种人也配当程序员?2
- compass 搜索引擎新手问题
- MyEclipse添加jar同名怎么办
- 权限设计问题
- 高手请进?我想这个问题对我来说真的很难!!!!!!!!!!!!!!
- 北京的jsp程序员来看看
- aq.executeQuery: [Microsoft][ODBC Microsoft Access 驱动程序] 客户端的工作过多
- 用JSP实现菜单功能!谢谢
- 求助ajax的url 路径问题!!!!
- 安装myeclipse6.5找不到系统指定的文件
- 各位帮忙看看这个问题怎样解决
<%
if(session.getAttribute("name")!=null)//判断用户名是不是为空
{
session.removeAttribute("name");//注销
}out.println("<script>alert('您已成功注销登录!');this.location.href='index.jsp';</script>");//回到首页
%> 我怎么把以上代码 加入到
<input type="button" value="注销" onclick=""/>
点击注销的时候肯定有跳转到一个jsp页面,或者action了,看你是struts2做的,你就直接跳转到action里面的一个方法里,然后移除你的session了,
可能你已经定义了一个submit了,但是你可以在button里写个onclick事件
window.location="请求action某个方法的地址"
在action里怎么做 ??
直接这样写嘛??
public String logoutLogin(){
Map session = ActionContext.getContext().getSession();
session.clear();
return "registerSuccess";
}