0
点赞
收藏
分享

微信扫一扫

JavaWeb08application&JavaBean

曾宝月 2022-04-06 阅读 28
eclipse

一、applocation

作用于服务器端 类似于全局变量跨用户

//应该先拿值
  Integer count=(Integer)application.getAttribute("count");
  if(count!=null){//拿到了 说明以前有人访问过
    count++;//在原来的访问量上递增1
  }
  else{
    count=1;
  }
  application.setAttribute("count", count);

二、JavaBean封装

把方法封装在Java Resources的src中

举报

相关推荐

0 条评论