struts如何控制一个frame跳转

wnba1983 2008-04-15 09:21:18
通常情况下我们在struts里面写的return mapping.findForward("tea");可以控制整个页面的跳转

但是我现在有个FrameSet结构的页面,代码如下:


<%@ page import="hbue.pojo.Teacher"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/eip2.css" rel="stylesheet" type="text/css">
<script src="../js/eip2.js" type=text/javascript></script>
<title>湖北经济学院教学辅助平台</title>
</head>
<%
//System.out.println("abcd");
//Teacher tea = (Teacher)session.getAttribute("tea");
//Teacher tea2 = (Teacher)request.getAttribute("tea");
//System.out.println("re "+tea.getTeaName());
//System.out.println("se "+tea2.getTeaName());
%>
<SCRIPT language=JScript>

</script>

<frameset name="subMainFrameSet" rows="*" cols="175,24,*" framespacing="0" frameborder="NO" border="0">
<frameset name="leftFrameSet" rows="77,*" cols="*" frameborder="no">
<frame src="include/user.jsp" name="userFrame" frameborder="no" scrolling="no" noresize id="userFrame">
<frame src="teacher/funcTree.htm" name="funcTreeFrame" frameborder="no" noresize id="treeframe" id="funcTreeFrame">
</frameset>
<frame src="include/control.htm" name="controlFrame" frameborder="no" scrolling="no" noresize id="controlFrame">
<frameset name="rightFrameSet" rows="26,*" cols="*" frameborder="no">
<frame src="include/place.htm" name="placeFrame" frameborder="no" scrolling="no" noresize id="placeFrame">
<frame src="teacher/teacherInfoManage/teacherInfo.jsp" name="contentFrame" frameborder="no" scrolling="auto" id="contentFrame">
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>

其中name="funcTreeFrame的frame是一个菜单树,当我点击一个菜单项的时候,可以提交给一个action,完成请求以后我想要
<frame src="teacher/teacherInfoManage/teacherInfo.jsp" name="contentFrame" frameborder="no" scrolling="auto" id="contentFrame">
这个farme中显示某个jsp,我的action代码,以及struts配置文件要怎么写啊?


...全文
116 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
seeSkyblue 2008-04-16
  • 打赏
  • 举报
回复
你说的这些其实与有没有用struts是无关的。
你可以去看看用普通html是怎么实现的,多看看html方面的知识。
wnba1983 2008-04-16
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 panxuan 的回复:]
直接使用 <frame src="teacher/teacherInfoManage/teacherInfo.do?参数" name="contentFrame" frameborder="no" scrolling="auto" id="contentFrame">
[/Quote]
这样首次登陆到frameset的那个页面是可以,那如果我点了这个frame页面的一个按钮,提交给了一个action,我只要求,当前的这个frame跳转,这是已经不是上面的src的对应的那个请求了,那我的action代码要怎么写啊,struts的配置文件要怎么写?
panxuan 2008-04-16
  • 打赏
  • 举报
回复
直接使用<frame src="teacher/teacherInfoManage/teacherInfo.do?参数" name="contentFrame" frameborder="no" scrolling="auto" id="contentFrame">
wnba1983 2008-04-16
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 AWUSOFT 的回复:]
在有具体连接的那些页面里.那些超链接的地方加了一个target属性
<a href="lll.jsp" target="frame名称">链接JSP </a>


<a href="aa.do" target="frame名称">链接Action </a>


其它的不用管了
[/Quote]

我回头试一下,还有,你说的这是一个链接的方法,那如果我是点击一个按钮,onClick一个事件,提交给了一个action,那如何控制一个固定的frame跳转啊。。
seeSkyblue 2008-04-16
  • 打赏
  • 举报
回复
同意楼上
awusoft 2008-04-16
  • 打赏
  • 举报
回复
在有具体连接的那些页面里.那些超链接的地方加了一个target属性
<a href="lll.jsp" target="frame名称">链接JSP</a>


<a href="aa.do" target="frame名称">链接Action</a>


其它的不用管了
gengxiecheng 2008-04-16
  • 打赏
  • 举报
回复
现在有点晕。。先看看
loaferwang 2008-04-16
  • 打赏
  • 举报
回复
没有玩过,up and up

67,538

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧