`
beyond429
  • 浏览: 94812 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

使ApplicationResources.properties支持中文

    博客分类:
  • java
阅读更多
使ApplicationResources.properties支持中文
建立一个ApplicationResources_ISO.properties文件,把应用程序用的message都写进去,
然后在dos下执行这个命令,是jdk/bin中的cmd:
native2ascii -encoding gb2312 ApplicationResources_ISO.properties ApplicationResources.properties
这样就会将ISO编码的ApplicationResources转换成GB2312编码的格式了,同时保存到
ApplicationResources.properties。这个文件需要保存在 \WEB-INF\classes目录中
native2ascii这个工具是jdk自带的一个东东,所以如果path都设定正确就可以直接运行了,
你可以在$java_home$/bin下找到他。
转换后的中文类似于这个样子:
iso 格式下 :tj.type=商品车类型
gb2312格式下 :tj.type=\u5546\u54c1\u8f66\u7c7b\u578b



我们需要这个软件 Properties Editor


下载地址:
http://propedit.sourceforge.jp/index_en.html

Properties Editor 可以通过以下方式来使用:手动安装Properties Editor的Jar包  或者 通过Eclipse自动安装
Help-->Software Updates-->Find and Install-->Search for new features to install-->New Remote Site-->name:这是一个插件名 URL:http://propedit.sourceforge.jp/eclipse/updates/

分享到:
评论

相关推荐

    ApplicationResources.properties

    这时,我们可以创建一系列的`ApplicationResources.properties`文件,每种语言一个,例如`ApplicationResources_en.properties`(英文)、`ApplicationResources_zh_CN.properties`(简体中文)。Java的`...

    解决Struts中ApplicationResources.properties文件不支持中文问题

    解决 Struts 中 ApplicationResources.properties 文件不支持中文问题 Struts 框架中,ApplicationResources.properties 文件是用于存储应用程序的资源文件,如按钮文字、菜单项、提示信息等。然而,默认情况下,...

    Struts中的国际化(资源文件的应用)

    对于其他语言,文件名需要加上语言代码,如`ApplicationResources_zh_CN.properties`表示简体中文版本。 在创建资源文件后,需要进行适当的编码转换,确保文件符合Web服务器的编码标准。例如,使用`native2ascii`...

    jp.gr.java_conf.ussiy.app.propedit_4.8.2

    它支持中文录入和显示,意味着该软件能够处理中文字符,对中文用户友好,适合在中国市场使用。描述还指出,软件包含“feature”和“plugins”目录,这通常意味着软件具有可扩展性,允许用户通过安装额外的功能模块...

    java web应用国际化与分页

    资源文件的命名遵循一定的规则,如`ApplicationResources.properties`作为默认资源,然后针对特定语言,如`ApplicationResources_en.properties`(英语)和`ApplicationResources_zh.properties`(中文)。...

    native2ascii

    此后,`applicationresources.properties`中的所有中文字符都将被转换成`\u`开头的Unicode序列。 #### 三、应用场景 `Native2Ascii`最常见于Java国际化(i18n)和本地化(l10n)的场景,特别是在处理多语言资源...

    毕业设计 网站

    5. **ApplicationResources.properties**:这也是一个资源文件,可能包含应用程序的通用文本,如按钮标签、提示信息等。可以配合Spring框架实现国际化,使得应用可以根据用户的语言环境显示不同的文本。 6. **...

    java 中文问题(java web 开发中的中文问题)

    在 Struts 中,ApplicationResources.properties 文件用于存储提示消息。解决中文提示消息问题,可以使用 Unicode 编码,例如: ```properties message=Hello, \u4f60\u597d ``` 八、saveErrors...

    struts-bean:message使用

    为支持多种语言,可以创建如`ApplicationResources_zh_CN.properties`(中文简体)和`ApplicationResources_en_US.properties`(美国英语)等。 三、`<bean:message>`标签的其他属性 1. `key`属性:必需,用于查找...

    struts国际化

    创建不同语言版本的资源文件,如`ApplicationResources_en.properties`(英语)和`ApplicationResources_zh_CN.properties`(简体中文)。这些文件包含应用中的所有国际化字符串,键值对形式如下: ``` label....

    struts1.x 最简洁国际化 源代码

    - 这告诉Struts在初始化时查找名为`ApplicationResources.properties`的资源包。 6. **控制器逻辑**: - 在Action类中,可以通过`ActionContext`获取当前的`Locale`,并根据它加载对应的资源包。然后,Action可以...

    myGuI Jlable

    描述 "ApplicationResources_zh.properties 转换后的unicode 编码文件,同样替换gb2312可以转换问其他的编码为unicode" 描述了一个国际化(i18n)和本地化(l10n)的过程。`ApplicationResources_zh.properties` 是一个...

    myi18n-demo.zip

    - 默认情况下,SpringBoot会在`src/main/resources`目录下查找`messages.properties`(默认语言,如英语)和`messages_{locale}.properties`(其他语言,如`messages_zh_CN.properties`对应简体中文)。 2. **配置...

    StrutsSpringHibernate实例

    - `ApplicationResources.properties`: ``` prompt.username=UserName prompt.password=UserPassword errors.required={0} is required. ``` - `ApplicationResources_zh_CN.properties`: ``` prompt....

    springboot国际化配置

    在 SpringBoot 中,你可以通过配置 `application.properties` 或 `application.yml` 来指定默认的消息源文件路径,如 `messages.properties` 和 `messages_zh_CN.properties` 分别代表英文和简体中文的文本。...

    Struts国际化完整dome

    资源文件通常是.properties格式,如`applicationResources_en.properties`(英文)和`applicationResources_zh_CN.properties`(简体中文)。这些文件包含键值对,键是消息的标识符,值是对应语言的消息内容。 4. ...

    struts的表单验证方式

    需要注意的是,原生的`ApplicationResources.properties`不支持中文,因此可能需要借助插件或其他方式来解决这个问题。 4. **处理中文乱码** 当表单验证成功并需要显示包含中文的错误信息时,可能会出现乱码问题。...

    Struts2的国际化

    在`struts-config.xml`中通过`<message-resources>`元素引入这些资源文件,若找不到特定的`xx_XX`文件,则回退至默认的`Application.properties`文件。在JSP页面中,使用`<bean:message key=""/>`标签输出国际化内容...

    SpringBoot 配置国际化完整源码

    对于多语言支持,我们需要创建多个文件,如`messages_en.properties`(英文)和`messages_zh_CN.properties`(简体中文)。每个文件包含一组键值对,键代表消息ID,值是对应语言的文本。 2. **MessageSource**: ...

    struts验证机制

    例如,`ApplicationResources_en_US.properties`和`ApplicationResources_zh_CN.properties`分别提供了英文和中文的错误消息。 #### JSP页面集成 在JSP页面中,可以利用Struts提供的标签库来显示验证错误。例如: ...

Global site tag (gtag.js) - Google Analytics