Tomcat Configuration Session Persistence

Source: Internet
Author: User

The management of the session, Tomcat two implementation classes: Org.apache.catalina.session.StandardManager and Org.apache.catalina.session.PersistentManager

Standardmanager The default method can be configured in less places

Persistentmanager provides a very flexible way to manage the configuration of strong

Form one: stored in a local file: Configure the Context.xml file in the Conf directory

1. Modified files: $Tomcat _home/conf/context.xml

2. Add the following below the root node of the context.xml file:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/80/5C/wKiom1c-iNCheqPMAADiEPdoZts157.jpg "title=" Ningzhiyuan 20160520114717.jpg "alt=" Wkiom1c-incheqpmaadiepdozts157.jpg "/>

3. If the JavaBean object is stored in the session, the JavaBean is required to implement the Serializable interface and contains an empty constructor.

Form two: Store in the Database Configuration store node

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/80/5C/wKiom1c-iPCic5rYAAEbWP6xaQw394.jpg "title=" 55.jpg "alt=" Wkiom1c-ipcic5ryaaebwp6xaqw394.jpg "/>

Classname:session's management class, Tomcat will apply the objects generated by the class through the defined interfaces.
The trace level of the Debug:session manager.
Saveonrestart: (true/false) Configure the service to restart the session processing, if true, before closing a valid session save, start and reload
maxactivesession: The maximum number of active session sessions is not limited when 1, otherwise the Session manager will transfer the exceeded session object to the session store.
minidleswap:session The minimum period of inactivity, over which the session Manager may transfer the session object to the session store in seconds.
Maxidleswap:session The maximum time that is inactive, the session Manager will transfer the session object to the session store, and the session will not be in memory.
Maxidlebackup:session The maximum time that is inactive, the session Manager will back up the session object to the session store, but the session object still exists in memory.
Store: Specifies the file location that implements the persisted class and session storage, As the class specified in this example is: Org.apache.catalina.session.FileStore, and the session object is stored in a directory that is the session folder under the Tomcat root directory



This article comes from "? Only! "Blog, be sure to keep this provenance http://renzhiyuan.blog.51cto.com/10433137/1775344

Tomcat Configuration Session Persistence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.