文章目录
日期格式转换
jsp页面显示的日期跟数据库格式不一样,在日期哪一行加入:
需要导入fmt包,不然无法生效
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:formatDate value="${user.birthDay}" pattern="yyyy-MM-dd"></fmt:formatDate>
如果还是没用就多重新运行几次。
增加或修改日期格式错误解决办法
导入依赖
<!-- joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
<!-- json-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
</dependency>
然后去对应的表实体类,添加注解
导包千万不要导错了
修改的方式: