HTTPSession variable limit

半城伤御伤魂 提交于 2019-11-28 04:23:18

问题


What is the maximum limit (i.e. size) of data that a HTTPSession variable can hold? What will happen if this exceeds? And most importantly, what is the alternative approach to have the data throughout the session if the size exceeds the maximum size that a HTTPSession variable can hold?


回答1:


There is no limit, other than the memory of your server. The alternatives are

  • to run your server with more memory
  • to configure the server to swap sessions to disk (see http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html for Tomcat)
  • to avoid putting large data in the session, and to use a cache or a database to store them instead.


来源:https://stackoverflow.com/questions/11699065/httpsession-variable-limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!