Velocity模板引擎下 velocity.properties转义(转码)配置
来源:互联网 发布:国轩高科待遇 知乎 编辑:程序博客网 时间:2024/05/23 01:18
转自http://blog.csdn.net/cuker919/article/details/8049450
velocity配置文件中的编码配置类:
//对html文件编码的配置
org.apache.velocity.app.event.implement.EscapeHtmlReference
//对JavaScript文件编码的配置
org.apache.velocity.app.event.implement.EscapeJavascriptReference
//对sql文件编码的配置
org.apache.velocity.app.event.implement.EscapeSqlReference
//对xml文件编码的配置
org.apache.velocity.app.event.implement.EscapeXmlReference
在velocity.properties中配置变量转义:
default.contentType=text/html; charset=UTF-8
input.encoding=UTF-8
output.encoding=UTF-8
eventhandler.referenceinsertion.class = org.apache.velocity.app.event.implement.EscapeHtmlReference
eventhandler.referenceinsertion.class = org.apache.velocity.app.event.implement.EscapeSqlReference
eventhandler.escape.html.match = /_html_*/
eventhandler.escape.sql.match = /_sql_*/
前台数据显示时 要转义的数据变量名定义需遵循:
格式:_html_自定义名字
例如:_html_title、_html_userName等等
- Velocity模板引擎下 velocity.properties转义(转码)配置
- Velocity模板引擎下 velocity.properties转义(转码)配置
- velocity模板引擎简介
- velocity 模板引擎
- Velocity模板引擎
- 【工具】模板引擎 Velocity
- Velocity模板引擎入门
- 模板引擎 Velocity
- Velocity 模板引擎介绍
- 模板引擎 Velocity
- velocity模板引擎处理
- Java模板引擎---Velocity
- Velocity模板引擎
- Velocity 模板引擎介绍
- velocity 模板引擎
- Velocity 模板引擎介绍
- Velocity模板引擎
- velocity模板引擎学习
- 非对称加密、数字摘要、数字签名、数字证书、SSL、HTTPS及其他
- php的tips(关联数组按某个键值排序)
- 使用 NuGet 管理项目库
- 使用swift解析json
- ProGuard详解
- Velocity模板引擎下 velocity.properties转义(转码)配置
- Android使用UncaughtExceptionHandler捕获全局异常
- Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled
- swift设置UIButton的title文字
- 在PowerShell中使用枚举类型
- Android native和h5混合开发几种常见的hybrid通信方式
- VMware Workstation cannot connect to the virtual machine
- Android中Build Target,minSdkVersitarget,targetSdkversion概念
- Generative Modeling of Convolutional Neural Networks,生成式CNNs