Memcached (11) Memcached-session-manager

Source: Internet
Author: User
Tags memcached tomcat

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/

Related Article

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.