Velocity 时间格式化问题
来源:互联网 发布:康丝数据 编辑:程序博客网 时间:2024/05/13 06:44
在web-inf下添加配置文件toolbox.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd"><toolbox> <!--数字格式化--> <tool> <key>NumberTool</key> <scope>application</scope> <class>org.apache.velocity.tools.generic.NumberTool</class> </tool> <!--日期格式化--> <tool> <key>date</key> <scope>application</scope> <class>org.apache.velocity.tools.generic.DateTool</class> </tool></toolbox>
在VelocityViewResolver中配置toolbox文件的位置
<bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"> <property name="suffix" value=".vm"></property> <property name="contentType" value="text/html;charset=UTF-8"></property> <property name="toolboxConfigLocation" value="/WEB-INF/toolbox.xml"></property> </bean>
在vm页面进行格式化
$date.format('yyyy-MM-dd HH:mm:ss ',$!{item.created})
========================================
嗯就是按照这个步骤来的,结果时间一直无法正常格式化,最后发现原因是数据没从数据库取出来……[微笑脸]
阅读全文
0 0
- Velocity 时间格式化问题
- velocity 格式化时间
- velocity格式化时间
- velocity 时间显示 时间格式化 时间转化
- velocity 时间显示 时间格式化 时间转化
- velocity (vm模板)时间显示 时间格式化 时间转化
- datalist时间格式化问题
- java 时间格式化问题
- java格式化时间问题
- java 时间格式化问题
- java时间格式化问题
- android 时间的格式化问题
- sqlite时间格式化相关问题
- jqGrid的时间格式化问题
- jqGrid的时间格式化问题
- jqgrid 时间戳格式化问题
- jqGrid的时间格式化问题
- velocity 输出格式化日期
- Hive分析函数之LAG、LEAD、FIRST_VALUE、LAST_VALUE学习
- Linux xshell 登录执行脚本
- 曾经它认识我,我不认识他的Linux系统
- opencv 图像显示函数使用
- 对于android编译包 ndk找不到str::to_string()
- Velocity 时间格式化问题
- CC2530 osal_start_timerEx()函数
- 优化iOS程序性能的25个方法
- java io本地文件读写积累 未完待续...
- Arrays类—Arrays.asList()方法使用
- Git之(一)Git是什么
- python 将pyc 文件反编译成py源文件
- R
- (ROS)hector_quadrotor 的编译运行