考虑速度模板中的以下代码段:
#set($brandName = $player.brand.name)
#set($brandNameExample = "NameExample")
#if($brandName == $brandNameExample)
11111
#else
22222
#end
Run Code Online (Sandbox Code Playgroud)
我总是得到22222
。当然,player.brand.name = "NameExample"
。
任何人都可以解释我为什么以及如何让它工作吗?
我的应用程序是由Spring休息控制器使用redis调用服务.我使用的是spring boot starter redis 1.2.5,我在beans.xml文件中定义了一个模板:
<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name="${spring.redis.host}"
p:use-pool="true"
p:port="${spring.redis.port}"
/>
<bean id="redisTemplateForTransaction" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"
p:keySerializer-ref="stringRedisSerializer"
p:valueSerializer-ref="jsonRedisSerializerForTransaction"
p:enableTransactionSupport="true">
<qualifier value="redisTemplateForTransaction" />
</bean>
Run Code Online (Sandbox Code Playgroud)
当我启动超过8个查询时,我的应用程序阻止.我知道我已达到池中的默认连接数.
为什么在请求处理结束时没有自动返回连接?
如何在事务模式下工作,以便任何传入的请求将获得其redis连接并在处理结束时返回它?