简体   繁体   English

JSP Web应用程序中的国际化?

[英]Internationalization in a JSP web application?

In my current project, we are looking at phasing out our old presentation layer and replacing it with something more modern and more well-known. 在我目前的项目中,我们正在考虑逐步淘汰旧的表示层,并将其替换为更现代,更知名的东西。 For various reasons, JSP was chosen as the technology. 出于各种原因,选择JSP作为技术。 Possibly in conjunction with Apache Tiles. 可能与Apache Tiles一起使用。 I should perhaps mention that we are using Spring in the back, if that matters at all. 我或许应该提到我们在后面使用Spring,如果这很重要的话。

Internationalization is a requirement, in particular the aspect of showing text messages in the user's language. 国际化是一项要求,特别是以用户的语言显示文本消息的方面。 It surprises me that there is not so much information about this as I had expected. 让我感到惊讶的是,没有像我预期的那样有关于此的信息。

What I have found is the JSTL fmt namespace. 我发现的是JSTL fmt命名空间。 Especially using fmt:message together with fmt:param . 特别是使用fmt:messagefmt:param However, most references I have found regarding using this technique appear dated. 但是,我发现大多数关于使用这种技术的参考文献都显示日期。

So, I am wondering if this is still recommended practice? 所以,我想知道这是否仍然是推荐的做法? If not, what are the alternatives? 如果没有,有哪些替代方案? Are there any good links on the subjects, describing how to successfully achieve i18n in a web application? 是否有关于主题的良好链接,描述如何在Web应用程序中成功实现i18n?

根据Java EE 5教程国际化标记库部分,这些标记不是过时的,是处理i18n JSP页面的标准方法。

i still using JSTL 1.2 for i18n. 我仍然使用JSTL 1.2 for i18n。 works like a charm. 奇迹般有效。 maybe not updated at all last years but is still does what is must do. 可能在去年没有更新,但仍然做必须做的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM