(1)有关框架刷新
需要实现效果:左边frame输入手机号码,右边主frame显示,如果登陆成功,左边frame需要刷新显示实际登陆手机号码,右边frame显示登陆后的数据。
1、左边left.jsp页面递交定义为
<form name="loginform" [color=red]target="mainFrame" [/color]method="post" action="/ColorTone/do/sys/user" οnsubmit="return validateLogonForm(this);">
这样可以实现所有的信息(出错、正常的)都在mainframe里面显示;
2、在struts配置文件里面定义一个全局出错页面
<forward name="failurePage" path="failurePage.jsp"/>
该页面通过[color=red]<bean:write name="errors" scope="request" filter="false"/> [/color]
与后台交互,显示出错信息。
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">
[color=red]<frame src="/ColorTone/do/sys/guest" name="mainFrame">[/color] </frameset>
</frameset>
<noframes>
<body>
</body></noframes>
</html>
[color=red]<script>top.leftFrame.location.reload();</script> [/color]
第一句负责在该页面打印出登陆后显示信息;
第二句负责刷新left.jsp页面,显示登陆用户的手机号码;
需要实现效果:左边frame输入手机号码,右边主frame显示,如果登陆成功,左边frame需要刷新显示实际登陆手机号码,右边frame显示登陆后的数据。
1、左边left.jsp页面递交定义为
<form name="loginform" [color=red]target="mainFrame" [/color]method="post" action="/ColorTone/do/sys/user" οnsubmit="return validateLogonForm(this);">
这样可以实现所有的信息(出错、正常的)都在mainframe里面显示;
2、在struts配置文件里面定义一个全局出错页面
<forward name="failurePage" path="failurePage.jsp"/>
该页面通过[color=red]<bean:write name="errors" scope="request" filter="false"/> [/color]
与后台交互,显示出错信息。
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">
[color=red]<frame src="/ColorTone/do/sys/guest" name="mainFrame">[/color] </frameset>
</frameset>
<noframes>
<body>
</body></noframes>
</html>
[color=red]<script>top.leftFrame.location.reload();</script> [/color]
第一句负责在该页面打印出登陆后显示信息;
第二句负责刷新left.jsp页面,显示登陆用户的手机号码;