velocity中$springMacroRequestContext.getMessage($code)
在Java国际化(i18n)中,
vm页面显示内容需要使用 #springMessage("title")
实际运行时发现页面输出$springMacroRequestContext.getMessage($code)。看了一下源代码,#springMessage是一个宏,在spring.vm中定义为
#macro( springMessage $code )$springMacroRequestContext.getMessage($code)#end
原因是因为未找到$springMacroRequestContext...
解决方法:在我们定义视图resolver中加入对spring宏的支持
<bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
...
<property name="exposeSpringMacroHelpers" value="true"/>
</bean>
velocity中$springMacroRequestContext.getMessage($code)的更多相关文章
- Java国际化(i18n)
Java国际化(i18n) 最近在做一个网站国际化的功能.用Java做开发,使用spring+velocity. Java提供了对i18n的支持,spring对其做了集成,可以很方便的配置.主要思想就 ...
- freemarker中使用<@spring.*>标签实现国际化
freemarker实现国际化使用自定义指令<@spring>实现,通过@符号可以看出是自定义的指令,在哪里定义的呢? 路径如下:org/springframework/spring-we ...
- Ajax 常用资源
regular online:http://regex.larsolavtorvik.com/ json online:http://json.cn/ Prototype:http://prototy ...
- Linux 下子线程 exit code 在主线程中的使用
Linux线程函数原型是这样的: void* thread_fun(void* arg) 它的返回值是 空类型指针,入口参数也是 空类型指针.那么线程的 exit code 也应该是 void * 类 ...
- Entity Framework 6 Code First +MVC5+MySql/Oracle使用过程中的几个问题
1. namespace Snapsia.Web.Models { using System; using System.Data.Entity; using System.ComponentMode ...
- ASP.NET MVC 学习6、学习使用Code First Migrations功能,把Model的更新同步到DB中
参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-th ...
- MVC学习6 学习使用Code First Migrations功能 把Model的更新同步到DB中
参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-th ...
- Lua 与C/C++ 交互系列:注冊枚举enum到Lua Code中
在Lua Code中注冊C/C++的枚举很easy,就像注冊全局变量一样.我们使用枚举名称作为命名空间,来避免注冊的枚举发生冲突.注冊的枚举存储在全局环境(线程环境)中. 当在Lua Code中訪问枚 ...
- 在 VS Code 中遇到的一些问题
1.在安装时未配置右键快捷菜单,想重新添加 最简单的就是重新安装一遍,在安装过程中选择好. 其次可以通过以下注册表脚本导入(保存为 .reg 文件),注意因为有中文字符,需要使用记事本保存为 ANSI ...
随机推荐
- 如何打开、关闭IIS服务器
问题描述:如题. 使用工具:腾讯云Windows Server 2012 R2 数据中心版 64位中文版. 操作步骤: 1.服务器管理器->IIS
- LAMP和LNMP
编译安装和yum安装 centos 7 可以使用10年 ubuntu可以使用5年 VirtualBox也是一个虚拟机 下载centos 安装centos exit 退出登陆 ping www.ba ...
- [No0000AD]7z源码完全移植至Visual Studio 2015
今天在上次的基础上(原文地址:[No0000AB]用Visual Studio 2015在 WIN10 64bit 上编译7-zip (32 bit)),将7Z的源码完全移植到了vs2015开发环境下 ...
- pcl曲面重建模块-poisson重建算法示例
poisson曲面重建算法 pcl-1.8测试通过 #include <iostream> #include <pcl/common/common.h> #include &l ...
- .NET MVC实现多图片上传并附带参数(ajaxfileupload)
做网站呢,都免不了要做图片上传. 还记得去年做微信的时候用WebAPI+ajaxfileupload.js做了一个能够附带参数上传的功能,博文地址:.NET WebAPI 实现图片上传(包括附带参数上 ...
- VS2010快捷键设置
1.进入工具----选项 对话框 2.选择 环境---->键盘 3. 在 [显示命令包含] 下面的对话框中输入"对齐"关键字,然后就会在这个编辑框下面一个文本窗口中显示关 ...
- 预览github上的html页面
譬如有个项目:https://github.com/wozhizui/ife/tree/DevTogether/task19 里面有html的示例文件index.html 我们点击进去看到的是一堆代码 ...
- c# treeview 基本知识
private void Form1_Load(object sender, EventArgs e) { BindTreeView(); treeView1.Focus(); treeView1.G ...
- WEB – Architecture
- UVA1585
#include<stdio.h> #include<string.h> int main(){ int n; ]; scanf("%d",&n); ...