直接用java定义变量传值 VelocityContext velocityContext = new VelocityContext(); // 转义的符号直接输出 velocityContext.put("myf","$" ); 使用方式 #{myf}