架构设计:Spring-Session分布式集群会话管理(1)

1.2.2.RELEASE

spring-mvc.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns=“http://www.springframework.org/schema/beans” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”

xmlns:context=“http://www.springframework.org/schema/context” xmlns:mvc=“http://www.springframework.org/schema/mvc”

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd

http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

Spring MVC Configuration

<context:property-placeholder ignore-unresolvable=“true” location=“classpath:config.properties” />

<context:component-scan base-package=“com.itstyle.web” use-default-filters=“false”>

<context:include-filter type=“annotation” expression=“org.springframework.stereotype.Controller”/>

</context:component-scan>

mvc:annotation-driven/

text/html;charset=UTF-8

<mvc:default-servlet-handler />

<mvc:resources mapping=“/static/**” location=“/static/” />

<mvc:view-controller path=“/” view-name=“redirect:${web.view.login}”/>

config.properties

#============================#

#===== System settings ======#

#============================#

#产品信息设置

productName=科帮网 srping session

copyrightYear=2017

version=V1.0.0

#分页配置

page.pageSize=10

#索引页路径

web.view.index=/index

#登陆页面

web.view.login=/login

#视图文件存放路径

web.view.prefix=/WEB-INF/views/

web.view.suffix=.jsp

#静态文件后缀

web.staticFile=.css,.js,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.htm,.html,.crx,.xpi,.exe,.ipa,.apk

spring-redis.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns=“http://www.springframework.org/schema/beans”

xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:context=“http://www.springframework.org/schema/context”

xmlns:aop=“http://www.springframework.org/schema/aop” xmlns:tx=“http://www.springframework.org/schema/tx”

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-autowire=“byName” default-lazy-init=“true”>

<context:property-placeholder location=“classpath:redis.properties” />

<bean id=“jedisConnectionFactory”

class=“org.springframework.data.redis.connection.jedis.JedisConnectionFactory”>

context:annotation-config/

redis.properties

#redis中心

redis.host=127.0.0.1

redis.port=6379

redis.password=123456

redis.maxIdle=100

redis.maxActive=300

redis.maxWait=1000

redis.testOnBorrow=true

redis.timeout=100000

web.xml

<?xml version="1.0" encoding="UTF-8"?>

spring_session

contextConfigLocation

classpath:spring-redis.xml

springSessionRepositoryFilter

org.springframework.web.filter.DelegatingFilterProxy

springSessionRepositoryFilter

/*

org.springframework.web.context.ContextLoaderListener

encodingFilter

org.springframework.web.filter.CharacterEncodingFilter

最后

本人也收藏了一份Java面试核心知识点来应付面试,借着这次机会可以送给我的读者朋友们

目录:

全靠这套面试题,才让我有惊无险美团二面拿offer  (面经解析)

Java面试核心知识点

一共有30个专题,足够读者朋友们应付面试啦,也节省朋友们去到处搜刮资料自己整理的时间!

全靠这套面试题,才让我有惊无险美团二面拿offer  (面经解析)

Java面试核心知识点

已经有读者朋友靠着这一份Java面试知识点指导拿到不错的offer了

全靠这套面试题,才让我有惊无险美团二面拿offer  (面经解析)

rk.web.filter.CharacterEncodingFilter

最后

本人也收藏了一份Java面试核心知识点来应付面试,借着这次机会可以送给我的读者朋友们

目录:

[外链图片转存中…(img-4xgs6xEC-1714203267887)]

Java面试核心知识点

一共有30个专题,足够读者朋友们应付面试啦,也节省朋友们去到处搜刮资料自己整理的时间!

[外链图片转存中…(img-2FlYMFtT-1714203267888)]

Java面试核心知识点

已经有读者朋友靠着这一份Java面试知识点指导拿到不错的offer了

[外链图片转存中…(img-2hUXorZT-1714203267888)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

  • 27
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值