我清空了session的值,为什么刷新主页面拿到的是session值是情况前的值
主页面是这样调用登录界面的<script>$("#LoginPage").load(contextPath+"/sharepage/sharepage_loginUI")...
主页面是这样调用登录界面的<script>$("#LoginPage").load(contextPath+"/sharepage/sharepage_loginUI");</script>
登录界面是这样的
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!--login start-->
<div class="login_nav">
<ul >
<s:if test="#session.currentUser!=null">
<li> 欢迎您,<s:property value="#session.currentUser.realname"/> !</li>
</s:if>
<s:else>
<li >用户名:<input type="text" id="username" name="username" /></li>
<li >密码:<input type="password" id="password" name="password" /></li>
<li ><input type="image" onclick="login();" style="width: 51px;" src="../img/new_login.gif"/></li>
</s:else>
<li <s:if test="#session.currentUser==null">style="width:400px!important; width:370px;"</s:if><s:else>style="width:660px;"</s:else> >
<s:if test="#backinfo!=null">
<span style="" id="backinfo" ></span>
</s:if>
<s:if test="#session.currentUser!=null">
<a href="javascript: exit();" >注销登录</a>
<a href="<%= request.getContextPath() %>/userCenter/userCenter_userCenterUI" target="_blank">会员中心</a>
</s:if>
<s:else>
<a href="<%= request.getContextPath() %>/user/registerUI" target="_blank">注册用户</a>
</s:else>
</li>
<li class="icon_02"><a href="<%= request.getContextPath() %>/knowledge/knowledge_knowledgeListUI" target="_blank">知识库</a></li>
<li class="icon_01"><a class="hrefs" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.163.com/');" href="#">设为首页</a></li>
</ul>
</div>
<!--login end-->
<script type="text/javascript">
<!--
$(document).ready(function(){
});
//-->
</script> 展开
登录界面是这样的
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!--login start-->
<div class="login_nav">
<ul >
<s:if test="#session.currentUser!=null">
<li> 欢迎您,<s:property value="#session.currentUser.realname"/> !</li>
</s:if>
<s:else>
<li >用户名:<input type="text" id="username" name="username" /></li>
<li >密码:<input type="password" id="password" name="password" /></li>
<li ><input type="image" onclick="login();" style="width: 51px;" src="../img/new_login.gif"/></li>
</s:else>
<li <s:if test="#session.currentUser==null">style="width:400px!important; width:370px;"</s:if><s:else>style="width:660px;"</s:else> >
<s:if test="#backinfo!=null">
<span style="" id="backinfo" ></span>
</s:if>
<s:if test="#session.currentUser!=null">
<a href="javascript: exit();" >注销登录</a>
<a href="<%= request.getContextPath() %>/userCenter/userCenter_userCenterUI" target="_blank">会员中心</a>
</s:if>
<s:else>
<a href="<%= request.getContextPath() %>/user/registerUI" target="_blank">注册用户</a>
</s:else>
</li>
<li class="icon_02"><a href="<%= request.getContextPath() %>/knowledge/knowledge_knowledgeListUI" target="_blank">知识库</a></li>
<li class="icon_01"><a class="hrefs" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.163.com/');" href="#">设为首页</a></li>
</ul>
</div>
<!--login end-->
<script type="text/javascript">
<!--
$(document).ready(function(){
});
//-->
</script> 展开
2011-08-02
展开全部
<div class="login_nav">
<ul >
<s:if test="#session.currentUser!=null">
<li> 欢迎您,<s:property value="#session.currentUser.realname"/> !</li>
</s:if>
<s:else>
<li >用户名:<input type="text" id="username" name="username" /></li>
<li >密码:<input type="password" id="password" name="password" /></li>
<li ><input type="image" onclick="login();" style="width: 51px;" src="../img/new_login.gif"/></li>
</s:else>
<ul >
<s:if test="#session.currentUser!=null">
<li> 欢迎您,<s:property value="#session.currentUser.realname"/> !</li>
</s:if>
<s:else>
<li >用户名:<input type="text" id="username" name="username" /></li>
<li >密码:<input type="password" id="password" name="password" /></li>
<li ><input type="image" onclick="login();" style="width: 51px;" src="../img/new_login.gif"/></li>
</s:else>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询