在Java国际化(i18n)中, vm页面显示内容需要使用 #springMessage("title") 实际运行时发现页面输出$springMacroRequestContext.getMessage($code).看了一下源代码,#springMessage是一个宏,在spring.vm中定义为 #macro( springMessage $code )$springMacroRequestContext.getMessage($code)#end 原因是因为未找到$spring…
Java国际化(i18n) 最近在做一个网站国际化的功能.用Java做开发,使用spring+velocity. Java提供了对i18n的支持,spring对其做了集成,可以很方便的配置.主要思想就是根据语言来读取不同的配置文件,来显示对应的文本.主要步骤如下: 1. 用两个properties文件来保存“符号”到对应语言的映射.如messages_en.properties和messages_zh.properties, 将其放到工程的classPath下 #messages_en.prop…
freemarker实现国际化使用自定义指令<@spring>实现,通过@符号可以看出是自定义的指令,在哪里定义的呢? 路径如下:org/springframework/spring-webmvc/5.0.6.RELEASE/spring-webmvc-5.0.6.RELEASE.jar!/org/springframework/web/servlet/view/freemarker/spring.ftl 打开spring.ftl文件,可以看到定义了很多宏指令,我列出几个常用的: #这个宏名称…
regular online:http://regex.larsolavtorvik.com/ json online:http://json.cn/ Prototype:http://prototypejs.org/download/ javascriptmvc:http://www.javascriptmvc.com/ RunJS:http://git.oschina.net/oschina/RunJS JQuery:http://jquery.com/download/ JQueryUI:…
Linux线程函数原型是这样的: void* thread_fun(void* arg) 它的返回值是 空类型指针,入口参数也是 空类型指针.那么线程的 exit code 也应该是 void * 类型的.但是在主线程怎么捕获子线程的 exit code 并使用的呢? 捕获的思路如下: 1. 在主线程中定义一个 void* tret; 2. 使用 pthread_join(tidxx, &tret); 这样就能够捕获到子线程的 exit code. 但是如何使用呢?这就取决于子线程中的 exit…
1. namespace Snapsia.Web.Models { using System; using System.Data.Entity; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] public partial class SnapsiaContext…
 参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table 本文内容: 1,学习Entity Framework Code First 迁移功能(Migrations) 2,更新Model Class(Model Class中添加新的字段),然后把更新应用于datebase. 默认情况下,就像我们之前用Mode…
 参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table 转:http://www.it165.net/pro/html/201403/10653.html 本文内容: 1,学习Entity Framework Code First 迁移功能(Migrations) 2,更新Model Class(Model…
在Lua Code中注冊C/C++的枚举很easy,就像注冊全局变量一样.我们使用枚举名称作为命名空间,来避免注冊的枚举发生冲突.注冊的枚举存储在全局环境(线程环境)中. 当在Lua Code中訪问枚举时,通过名称来訪问相应的值. sample_9.cpp   c++代码例如以下: //在Lua Code中注冊的enum,为了避免冲突,以名称作为enumTable来存储 enum Week { Monday, Tuesday, Wednesday, Thursday, Friday, Satur…
1.在安装时未配置右键快捷菜单,想重新添加 最简单的就是重新安装一遍,在安装过程中选择好. 其次可以通过以下注册表脚本导入(保存为 .reg 文件),注意因为有中文字符,需要使用记事本保存为 ANSI 编码,否则会乱码. 来源:https://thisdavej.com/right-click-on-windows-folder-and-open-with-visual-studio-code/ Windows Registry Editor Version 5.00 ; 文件右键 [HKEY_…