小编Aka*_*vda的帖子

查找缺少的日期(PostgreSQL)

我有一个包含d_date列的表.在此列中,仅包含日期值.

我的问题是"我想从这个专栏(d_date)中找到缺少的日期".

示例:此列包含从"2007年1月1日"到"2007年1月7日"的日期,然后我想找到"2007年1月1日"到"2007年1月10日"之间缺少日期,我的结果应该是"2007年1月8日","2007年1月9日","2007年1月10日".

那么,我怎样才能得到这个结果呢?

postgresql

9
推荐指数
1
解决办法
1967
查看次数

Spring Data Redis Expire Key

我有一个Spring Spring Hibernate应用程序.在我的应用程序中,最近我实现了Spring数据Redis.

spring-servlet.xml
<!-- redis connection factory -->
<bean id="jedisConnFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:use-pool="true"/>

<!-- redis template definition -->
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate" 
    p:connection-factory-ref="jedisConnFactory"/>
Run Code Online (Sandbox Code Playgroud)

redisTemplate在我的ServiceImpl类中使用.

RedisServiceImpl

@Autowired
private RedisTemplate<String, T> redisTemplate;

public RedisTemplate<String, T> getRedisTemplate() {
    return redisTemplate;
}

public void setRedisTemplate(RedisTemplate<String, T> redisTemplate) {
    this.redisTemplate = redisTemplate;
}
Run Code Online (Sandbox Code Playgroud)

现在我在redisServer中添加了这样的数据

public void putData(String uniqueKey, String key, Object results) {

    redisTemplate.opsForHash().put(uniqueKey, key, results);
}
Run Code Online (Sandbox Code Playgroud)

现在我想删除Expire键.

我在谷歌搜索,但谷歌都是这样说的

redisTemplate.expire(key, timeout, TimeUnit);
Run Code Online (Sandbox Code Playgroud)

在这个过期方法中,我们需要提供uniqueKey而不是key.但我需要过期key而不是uniqueKey.

所以,请帮助我,我能做什么到期Key

java spring hibernate redis

9
推荐指数
5
解决办法
4万
查看次数

在 Apache Tiles 中使用核心库设置变量

我有一个模板 JSP 页面:

<html>
<head></head>
<body>
    <c:set var="temp" scope="request" value="" />
    <tile:insertAttribute name="header"/>
    <tile:insertAttribute name="body"/>
    <tile:insertAttribute name="footer"/>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我的模板 XML 如下:

<tiles-definitions>

    <definition name="home" extends="template">
        <put-attribute name="temp" value="home" />
        <put-attribute name="body" value="/WEB-INF/pages/home.jsp" />  
    </definition>

    <definition name="template" template="/WEB-INF/templates/template.jsp">
        <put-attribute name="temp" />
        <put-attribute name="header" value="/WEB-INF/pages/includes/header.jsp" />
        <put-attribute name="body"  />
        <put-attribute name="footer" value="/WEB-INF/pages/includes/footer.jsp" />
    </definition>
<tiles-definitions>
Run Code Online (Sandbox Code Playgroud)

我的问题:

当我在 home 定义"home"中的"temp"name 中设置了值时,我想"home"在页眉页和页脚页中获取此值,所以我这样做了,${temp}但我还没有找到"home"值。

这是可能的?如果是,那么如何?

java jsp jstl tiles apache-tiles

4
推荐指数
1
解决办法
2280
查看次数

标签 统计

java ×2

apache-tiles ×1

hibernate ×1

jsp ×1

jstl ×1

postgresql ×1

redis ×1

spring ×1

tiles ×1