当前位置: 代码迷 >> J2EE >> strust2 action跳转有关问题
  详细解决方案

strust2 action跳转有关问题

热度:385   发布时间:2016-04-22 02:18:40.0
strust2 action跳转问题

main.html 界面代码
Java code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xxxxx工作平台</title></head><frameset rows="127,*,11" frameborder="no" border="0" framespacing="0">  <frame src="top.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" />  <frame src="center.html" name="mainFrame" id="mainFrame" />  <frame src="down.html" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" /></frameset><noframes><body></body></noframes></html>


center.html:

Java code
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xxxx工作平台</title><style type="text/css"><!--body {    margin-left: 0px;    margin-top: 0px;    margin-right: 0px;    margin-bottom: 0px;    overflow:hidden;}--></style></head><body><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">  <tr>    <td width="8" bgcolor="#353c44">&nbsp;</td>    <td width="147" valign="top"><iframe height="100%" width="100%" border="0" frameborder="0" src="left.html"></iframe></td>    <td width="10" bgcolor="#add2da">&nbsp;</td>    <td valign="top"><iframe height="100%" width="100%" border="0" frameborder="0" src="right.html"></iframe></td>    <td width="8" bgcolor="#353c44">&nbsp;</td>  </tr></table></body></html>


我在left.html里,建个action跳转,我想跳转到right.html,可是怎么会跳到到left框框里?


------解决方案--------------------
就应该是这样的啊! 你用到了iframe,就只能在iframe里面跳转啊
------解决方案--------------------
用target指明你要跳到哪个框。简单如下:
<form action="HelloWorld.action" target="mainFrame">
<input type="submit">
</form>
别用id,用name
------解决方案--------------------
用target指明你要跳到哪个框。简单如下:
<form action="HelloWorld.action" target="mainFrame">
<input type="submit">
</form>
别用id,用name
这种方式还是听不错的啊!
------解决方案--------------------
跳转的时候指定路径
  相关解决方案