将如下配置增加到context.xml中
port="6379"
database="0"
maxInactiveInterval="60"/>
将jar包复制到tomcat的lib目录下
tomcat-redis-sessionmanage-1.2.jar
commons-pool-1.6.jar
jedis-2.1.jar
新建两个Web应用test1,test2
在test1应用的index.jsp中增加如下代码
<%
session.setAttribute("shareSession", "redis share Session")
%>
test2 index.jsp
在test2应用的index.jsp中增加如下代码
<%=session.getAttribute("shareSession")%>(输出为NULL)