`

项目部分经验

阅读更多
(1)有关框架刷新
需要实现效果:左边frame输入手机号码,右边主frame显示,如果登陆成功,左边frame需要刷新显示实际登陆手机号码,右边frame显示登陆后的数据。
1、左边left.jsp页面递交定义为
<form name="loginform" target="mainFrame" method="post" action="/ColorTone/do/sys/user" onsubmit="return validateLogonForm(this);">
这样可以实现所有的信息(出错、正常的)都在mainframe里面显示;
2、在struts配置文件里面定义一个全局出错页面
    <forward name="failurePage" path="failurePage.jsp"/>
该页面通过<bean:write name="errors" scope="request" filter="false"/>
与后台交互,显示出错信息。
3、配置登陆成功后显示页面
  <action path="/sys/user" parameter="USER" type="com.srt.vas.colortone.web.action.LoginAction">
    <forward name="success" path="/indexnew.jsp"/>
  </action>
该indexnew.jsp页面主要内容为

<frameset frameborder="NO" border="0" framespacing="0">
    <frame src="/ColorTone/do/sys/guest" name="mainFrame">  </frameset>
</frameset>
<noframes>

<body>

</body></noframes>
</html>
<script>top.leftFrame.location.reload();</script>
第一句负责在该页面打印出登陆后显示信息;
第二句负责刷新left.jsp页面,显示登陆用户的手机号码;
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics