tomcat的lib下添加jar包
修改tomcat的conf目录下的context.xml文件
新增 sessionCookiePath="/"
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:xxx.xxx.xxx.xxx:11211,n2:xxx.xxx.xxx.xxx:11211" sticky="false" sessionBackupAsync="false" lockingMode="auto" requestUriIgnorePattern=".*.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory" />
把测试的jsp(session.jsp)文件丢到apache-tomcat-7.0.57/webapps/ROOT 目录中进行测试
SessionID:<%=session.getId()%> <BR> SessionIP:<%=request.getServerName()%> <BR> SessionPort:<%=request.getServerPort()%>