你是指jsp里面想使用类似全局变量的东西吗?可以考虑放在application中

解决方案 »

  1.   

    Do you mean "Static storage"? "Static" is used here in the sense of "in a fixed location" (although it's also in RAM). Static storage contains  data that is available for the entire time a program is running.
      

  2.   

    When you say something is static, it means that data or method is not tied to any particular object instance of that class. So even if you've never create an object of that class you can call a static method or access a piece of static data.An important use of static for methods is that you can call a method without creating an object. This is essential for that main() method play as the main entry for a program.
      

  3.   

    And please pay attention to static initialization:The static initialization occurs only if it's necessary. So only the first time that object is created or the first static access occurs, they get be initialized, after that, the static objects are not reinitialized.