---
title: "Velocity 表示式失效原因"
author: "wutao8818"
date: "2014-01-06T15:27:01Z"
tags: ["velocity"]
categories: ["编程语言"]
slug: "velocity"
draft: false
lastmod: "2014-01-06T15:28:11Z"
id: 1999676
url: "https://wutaoo.iteye.com/blog/1999676"
---

\[code="java"] $date.format("yyyy-MM-dd","${result.modifyTime}")\[/code] 最近迁移服务器，有套使用Velocity系统的所有时间的velocity表达式都失效了。 在反复调试后发现是一个\[quote]""\[/quote]造成的。 $date.format("yyyy-MM-dd",\[color=red]"\[/color]${result.modifyTime}\[color=red]"\[/color]) 去掉值外面的双引号后，表达式恢复正常。 \[code="java"] $date.format("yyyy-MM-dd",${result.modifyTime})\[/code]