VMainSpace.jsp:function LoginOut()
{
$.post("Login_LoginOut",function(data)
{
var json=$.parseJSON(data);
if(json.msg=="loginout")
{
window.location.href="index";
}
}).error(function(data)
{
alert("error");
});
}LoginAction.java :public String LoginOut() {
this.setReturnurl("/jsp/Main/index");
ServletActionContext.getRequest().getSession().invalidate();
System.out.println("invalidate!!!!!");
JsonResultDTO json=new JsonResultDTO();
json.setMsg("loginout");
this.writeJson(json);
return "LoginOut";
}
struts.xml:<action name="index">
<result>jsp/Main/index.jsp</result>
</action>
{
$.post("Login_LoginOut",function(data)
{
var json=$.parseJSON(data);
if(json.msg=="loginout")
{
window.location.href="index";
}
}).error(function(data)
{
alert("error");
});
}LoginAction.java :public String LoginOut() {
this.setReturnurl("/jsp/Main/index");
ServletActionContext.getRequest().getSession().invalidate();
System.out.println("invalidate!!!!!");
JsonResultDTO json=new JsonResultDTO();
json.setMsg("loginout");
this.writeJson(json);
return "LoginOut";
}
struts.xml:<action name="index">
<result>jsp/Main/index.jsp</result>
</action>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货