zoukankan      html  css  js  c++  java
  • Session 和 Cache 的比较

        简单点说
        Session   是对针对单个连接来使用的,例如一些登陆用户的信息;  
        Cache   是对全局来定的,例如某些子控件地重复使用,广告等。

    Session 在使用中还有一些比较迷惑的地方

    HttpSession session =  request.getSession() 与 HttpSession  session =  request.getSession(true)

    有何区别?   
        
      二者在效果上没有区别。request.getSession()会自动调用request.getSession(true)。  
     
      request.getSession(boolean create)  
          如果有与当前的request相关联的HttpSession,那么返回与当前request关联的HttpSession,  
          如果还没有,那么:  
          如果   create   ==   true   那么返回一个新建的HttpSession;  
          如果   create   ==   false,那么返回   null。  

     

  • 相关阅读:
    关于input()
    HDU 3746
    HDU 4335 Contest 4
    HDU 4418 高斯消元法求概率DP
    HDU 4339 Contest 4
    HDU 4334 Contest 4
    HDU 4333 Contest 4
    HDU 4332 Contest 4
    HDU 4035
    HDU 4336
  • 原文地址:https://www.cnblogs.com/eoiioe/p/1140847.html
Copyright © 2011-2022 走看看