Introduced
Memcached-session-manager is the session in Tomcat, hosted into the Memcache management, to achieve the stateless application of Tomcat.
But in the author's experience, we generally do not use this technique when developing. Instead, you use the session in an existing project and quickly upgrade to a stateless application using this approach.
Relevant official
Https://code.google.com/p/memcached-session-manager/downloads/list
http://javolution.org/
Http://www.couchbase.com/develop/java/current
Detailed tutorials
http://blog.csdn.net/ichsonx/article/details/6911358
http://www.iteye.com/topic/1125301
Attachment is the Lib package used in this tutorial
Installation of TOMCAT7
Copy all the jars in the attachment to the ${tomcat_home}/lib directory.
Note: The engineering directory cannot have these jar packs
Modify the context node under Meta-inf/context.xml or ${tomcat_home}/conf/server.xml under the engineering directory to increase
XML code
<manager classname= "De.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachednodes= "N1 : 192.168.56.2:11211 "
requesturiignorepattern=". *\. ( Png|gif|jpg|css|js|ico) $ "
sessionbackupasync=" false "
sessionbackuptimeout=
" transcoderfactoryclass= "De.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory"
Copycollectionsforserialization= "false"
/>
Test
Open it with 2 browsers, first with Chrome and then with Firefox. See if Jsessionid is consistent.
JSP test Code
XML code
<%@ page language= "java" contenttype= "text/html charset=utf-8" pageencoding= "UTF-8"%> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
From Iteye, Author: 85977328
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/