struts2 的国际化
生活随笔
收集整理的這篇文章主要介紹了
struts2 的国际化
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、使用步驟
1)寫資源文件,資源文件名命名規范和之前的講的一致,有疑問請參考java開發中國際化
?
2)配置,在 struts.xml 中使用常量進行加載
struts.custom.i18n.resources=properties文件的基礎名+包名,例如<constant name="struts.custom.i18n.resources" value="com.baidu.properties.msg"></constant>
?
3)使用,在web 頁面中引入struts標簽,使用<s:text name="key"> 設置name屬性為properties文件的key值。
<%@taglib uri="/struts-tags" prefix="s"%> 。。。 <title><s:text name="title"></s:text></title> 。。。?
總結
以上是生活随笔為你收集整理的struts2 的国际化的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于Keil-MDK
- 下一篇: 【BZOJ4821】【SDOI2017】