当前位置: 代码迷 >> Web前端 >> Frameset 使用中有关问题
  详细解决方案

Frameset 使用中有关问题

热度:750   发布时间:2012-11-06 14:07:00.0
Frameset 使用中问题

1.在使用Frameset中,点击左侧部分链接都正常显示,但是如果直接在浏览器中输入左侧一个链接则不会显示所有框架,为什么?目前为止我不知道如何解决!

2.在系统中添加拦截器,只对LoginAction不拦截,其余链接则判断使用登录(seesion!=null),当用户登录后,直接在浏览器中输入左侧一个链接,显示登录页面,但是再从这个页面输入用户名密码后进入系统,系统会在点击左侧刚才输入的链接时显示login.jsp,解决办法:

public String intercept(ActionInvocation invocation) throws Exception {
		HttpServletResponse response=ServletActionContext.getResponse();
		   Object action = invocation.getAction();  
	         if (action instanceof PermissionAction) {  
	             return invocation.invoke();  
	        }
	         Map sessionmap = invocation.getInvocationContext().getSession();  
	         PermissionVo user = (PermissionVo) sessionmap.get(USER);  
	         if (user != null) {   
	             return invocation.invoke();  
	        } else {  
//解决上述问题的关键部分
	        	response.setHeader("Pragma","No-cache");
	            response.setHeader("Cache-Control","no-cache");
	            response.setDateHeader("Expires",0);
	             return INDEX;  
	   
	         } 
	}
1 楼 powerspring 2010-10-14  
第1条,讲讲我的理解,希望我没有搞错你的意思。点击左侧的链接,这个链接会有一个target指定主显示区(如,mainFrame),如果在地址栏访问这个链接,那主显示区就是你的浏览器,而不是frameset指定的主显示区了。