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

讓框架跳轉到以上頁面,這樣就能解決標題中的問題了!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章