原始森林中的一个狼窝

常用链接

统计

积分与排名

我的好友

最新评论

自动刷新/跳转

// Session 中存放计数器,体现刷新效果。

int count = 0;

Object obj = request.getSession().getAttribute( "count" );

if (obj == null ) {

    count = 1;

}

try {

    count = 1 + Integer.parseInt(obj.toString());

} catch (Exception e) {}

request.getSession().setAttribute( "count" , count);

 

// 设置自动刷新,一秒钟一次。

//response.setHeader("Refresh", "1");

 

// 设置自动跳转,一秒钟一次。我写的 url 是自己,所以和刷新一样。

response.setHeader( "Refresh" , "1,URL=refresh.do" );

posted on 2006-10-19 12:15 白洋 阅读(461) 评论(0)  编辑  收藏 所属分类: Struts 知识点滴


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


网站导航: