日期:2014-05-16 浏览次数:20786 次
	function show_userList(){
		$.ajax({
			type: "GET",
  			url: "ms/user!userList.action?dd="+new Date().getTime(),
			success: function(msg){
				     $("#bd").html(msg);
					},
			complete:function(XMLHttpRequest,textStatus){ 
                 if(textStatus=="error"){
                  	var ll = "<%=basePath%>";
                  	alert("basePath : "+ll);
                    window.location=ll+"/login"; 
                 } 
             }
		});
	}
 而$.get()、$.load()、$.post()方式的回调函数都是调用成功返回才会触发的回调函数,所以只能使用如上这种方式!	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		
		LoginInfoVO login = (LoginInfoVO)ServletActionContext.getRequest().getSession().getAttribute("login");
		//如果为空,则返回到登录页面
		if(login == null){
			ServletActionContext.getResponse().setStatus(501);
			return "login";
		}
		
		//继续向下执行
		return invocation.invoke();
	}