java - 为什么 struts 资源包具有 myresource.properties 和 myresource_en.properties 文件

标签 java jsp jakarta-ee struts2 struts

struts具有默认资源属性“myresource.properties”和语言资源属性“myresource_en.properties”,但在我的项目中实时,我在“myresource.properties”文件中拥有所有英语非适应内容,那么为什么我们需要使用“myresource_en.properties”文件。

谁能解释一下为什么struts默认使用“myresource.properties”,英语默认使用“myresource_en.properties”。

最佳答案

上面提到的_xx代表您想要支持的语言的国家ISO代码。如果您想支持英语和德语,则必须提供文件:

myresource_de.properties (German)

myresource_en.properties (English)

myresource.properties (fallback for all other ISO codes)

编辑:

myresource.properties (fallback for all other ISO codes)

这用于保存十六进制数字字符等字符

关于java - 为什么 struts 资源包具有 myresource.properties 和 myresource_en.properties 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5510438/

相关文章:

java - Java中按大写字母分割

javascript - Switch 函数运行但大小写被忽略

mongodb - 基于 Spring Boot 的项目中的 Spring Data MongoDB 配置

java - 取消部署 Java EE 应用程序时如何停止线程?

multithreading - 如何在多线程应用程序中刷新OAUTH2 BOX token

java - onActivityResult 请求代码返回 0

java - DDD 项目的 Maven 模块布局

java - 如何在java中导入javax?

java - 错误: The value for the useBean class attribute user. CompileClasss无效

java - 由于长时间运行的连接而阻塞线程?