Use spring-session and shiro to proxy session configuration

Use spring-session and redis to proxy session configuration
<!-- Here is to provide the parameters passed in the constructor for the following Session policy filter, because the Session filter depends on the object to construct, so create a first -->
    <bean name="redisOperationsSessionRepository" class="org.springframework.session.data.redis.RedisOperationsSessionRepository">
        <constructor-arg ref="jedisConnectionFactory"></constructor-arg>
    </bean>
    <!-- This is the Session policy filter, which replaces the original Session persistence mechanism of the container with Spring's Redis persistence Session mechanism. -->
    <!-- Note that this name must be consistent with the lower value of targetBean in web.xml. -->
    <bean name="springSession" class="org.springframework.session.web.http.SessionRepositoryFilter">
        <constructor-arg ref="redisOperationsSessionRepository"></constructor-arg>
    </bean>



    web.xml needs to add the following configuration
     <filter>
        <filter-name>spring-session</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetBeanName</param-name>
            <param-value>springSession</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>spring-session</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>



So is it possible to imitate this and use shiro's session as a proxy (as for whether shiro uses redis or ehcache, ignore it)? , This is to directly block session access, which is consistent with Shiro's configuration. Don't care if it is httpSession or shiro session.
1. Implement FindByIndexNameSessionRepository, MessageListeneri interface

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326885100&siteId=291194637