五、配置Tomcat参数并创建测试页面(其他Tomcat配置类似)[root@localhost jar]# vim /usr/local/tomcat/conf/context.xml <Context> <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /> <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" host="192.168.5.253" port="6379" database="0" maxInactiveInterval="60" /> </Context> [root@localhost jar]# mkdir -pv /usr/local/tomcat/webapps/session/WEB-INF/{classes,lib} [root@localhost jar]# vim /usr/local/tomcat/webapps/session/index.jsp <%@ page language="java" %> <html> <head><title>Tomcat1</title></head> <body> <h1><font color="red">Tomcat1.example.com</font></h1> <table align="centre" border="1"> <tr> <td>Session ID</td> <% session.setAttribute("Tomcat.example.com","Tomcat.example.com"); %> <td><%= session.getId() %></td> </tr> <tr> <td>Created on</td> <td><%= session.getCreationTime() %></td> </tr> </table> </body> </html> 六、测试
(责任编辑:好模板) |