学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

struts 里面的 jsp 页面带有 iframe 的转向问题

struts 里面的 jsp 页面带有 iframe 的转向问题

有一个 Jsp 页面,里面分别有两个 iframe ,在这每个 iframe 里面又分别有个 jsp 页面,我想在点击左面的 iframe 里面的 jsp 页面的连接时通过 struts-config.xml 里面的
<action path="..." type="...">
    <forward name="test" path="这里就是右面的 iframe 里面的 jsp 页面" />
</action>
转向到右面这个 iframe 里面的 jsp 页面,怎么实现啊!!! 当中要经过 Action 的处理,比如说这个连接就是查询数据库表中的结果集,把返回的结果集在右边的 jsp 中显示!!!

TOP

试试看

向你说的这样的具体的工程我没做过,但是,我感觉,应该在你左边的iframe的页面超链接里做,点击超链接的时候就指定好target=“右边iframe的id”,这样估计就能跳转过去,你试试,应该差不多

TOP

document.getElementById(iframeId).src = actionName;

TOP

3Q

谢谢啊,我试过了,不行啊!还有没有更好的办法!

TOP

这样肯定是可行的,我用过。下面是页面的部分代码

//js
function addRoom(action){
    var id = document.getElementById("id").value;
    action = action + "?id=" + id;
    var iframe = document.getElementById("page");
    iframe.src = action;
}
//调用js的按钮
<input name="button" type="button" class="buttonpop" onClick="javascript:addRoom('toAddPage.action');" value="新增档案室" />
//iframe
<iframe src="notify.jsp"  frameborder="0" name="page"  width="100%" height="500" scrolling="auto" id="page">
        </iframe>

TOP

Good

这样行啊,谢谢啊!!

TOP

发新话题