访问WEB-INF下使用frameset标签页面出错的原因

来源:互联网 发布:西西软件盒安卓版 编辑:程序博客网 时间:2024/05/24 16:16
<frameset rows="61,*,24" cols="*" framespacing="0" frameborder="no" border="0">   
     <frame src="top.jsp" tag=top" name="topFrame" scrolling="false" noresize="noresize" id="topFrame" />   
     <frame src="main.jsp" name="mainFrame" id="mainFrame" />   
    <frame src="down.jsp"      tag=down" name="bottomFrame" scrolling="false" noresize="noresize" id="bottomFrame" />   
</frameset>   
<noframes>
</noframes>
如果上面的页面是放在WEB-INF下,会发生不能访问top.jsp、main.jsp、down.jsp等页面,这是因为WEB-INF下这些页面本身是不能在浏览器中被访问的,如果你直接通过frameset来访问,那是访问不了,但是一些框架能做到这一点,比如:struts2,可以把上面改为如下:
<frameset rows="61,*,24" cols="*" framespacing="0" frameborder="no" border="0">   
     <frame src="frame .action?flag=top" tag=top" name="topFrame" scrolling="false" noresize="noresize" id="topFrame" />   
     <frame src="frame .action?flag=main" name="mainFrame" id="mainFrame" />   
    <frame src="frame .action?flag=down"      tag=down" name="bottomFrame" scrolling="false" noresize="noresize" id="bottomFrame" />   
</frameset>   
<noframes>
</noframes>

让框架跳转到以上页面,这样就能解决标题中的问题了!


http://blog.csdn.net/sunitjy/article/details/7872312