在jsp页面的里面添加:

$("document").ready(function(){

if (top != window) {//处理session为空的登录页面问题
top.location.href = window.location.href;
}

//处理session为空的登录页面问题
if(window.top.location.href!=location.href){
window.top.location.href=location.href;
}

});