Tapestry中防止恶意用户登陆的方法,即保护页面的方法

Page的java文件要实现PageValidateListener接口,
完成pageValidate(PageEvent event)方法
注意public void pageValidate(PageEvent event) {
if (!getUserExists()) {
Login login = getLoginPage();
login.setNextPage("Confirm");
throw new PageRedirectException(login);
}
}
注意这里要用PageRedirectException方法,因为As the rendering
has begun, calling activate() will have no
effect. To interrupt the rendering of the
current page and render another page,
you need to throw a
PageRedirectException.

这里是服务器内部跳转
The URL displayed in the
browser will not be changed
because the redirection
happens inside Tapestry
only.

posted on 2007-11-05 11:33 刘铮 阅读(268) 评论(0)  编辑  收藏 所属分类: Tapestry


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

留言簿(1)

文章分类(141)

文章档案(147)

搜索

最新评论