`
aijuans
  • 浏览: 1547829 次
社区版块
存档分类
最新评论

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

阅读更多

<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>

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

更多详细信息请查看java教程网 http://www.itchm.com/forum-59-1.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics