gpt4 book ai didi

java - HeaderHttpSessionIdResolver 配置

转载 作者:行者123 更新时间:2023-12-02 04:22:46 28 4
gpt4 key购买 nike

Spring session java xml 配置 xml 文件配置不自动写入 SpringHttpSessionConfiguration ->setHttpSessionIdResolver

applicationContext.xml

<bean class="redis.clients.jedis.JedisPoolConfig" id="jedisPoolConfig">
</bean>
<bean id="jedisConnFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:use-pool="true">
<property name="hostName" value="192.168.0.87"/>
<property name="port" value="6379"/>
<property name="poolConfig" ref="jedisPoolConfig"/>
</bean>

<bean id="redisTemplate"
class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="jedisConnFactory"/>
</bean>
<bean
class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration">
</bean>

<bean class="org.springframework.session.web.http.HeaderHttpSessionIdResolver" factory-method="xAuthToken"
id="httpSessionIdResolver"/>

配置后没有从head获取session

最佳答案

替换

但不明白为什么

关于java - HeaderHttpSessionIdResolver 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56625863/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com