<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    鷹翔宇空

    學(xué)習(xí)和生活

    BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
      110 Posts :: 141 Stories :: 315 Comments :: 1 Trackbacks
    原文引自:http://fjy26.itpub.net/

    1. configure web.xml,insert following tag:
      <init-param>
      <param-name>locale</param-name>
      <param-value>true</param-value>
      </init-param>
      codes above enable localization.
    2. configure web.xml,insert following tag:
      <init-param>
      <param-name>application</param-name>
      <paramvalue>ApplicationResources</param-value>
      </init-param>
      codes above indicate where default resource(ApplicationResources.properties) file reside in.If a specific resource locale is required, the actionServlet will look for resource file named ApplicationResources_xx_XX.properties according to locale. for example:ApplicationResources_en_us.properties
      hint:the default path of resource file is WEB-INF/classes/.
    3. using the struts framework locale object.
      after above two steps, struts stores a locale object in session context,you can get the object using following codes:
      Locale locale=(Locale)request.getSession().getAttribute(Action.LOCALE_KEY);
    4. changing user's locale
      Since locale is immutable ,you must create a new locale object to replace existing one:
      Locale locale=new Locale(myForm.getLanguage(),myForm.getCountry());
      HttpSession session=request.getSession(true);
      session.setAttribute(Action.LOCALE_KEY,locale);
    5. placing labels and messages in properties files.
    6. creating language-specified properties file for every locale you will support. if properly named,these files will be loaded automatically.if the application can't find a key in the resource for a user's locale,it will use the resource for the default locale.
    7. localization-aware components VS other components
      usually,most struts components support I18N automatically.for the components that do not have lacalization built in,you can usually use<bean:message> to provide localized message.
    8. localizing other components: validation and tiles
      validation:all the labels and messages used by validator are linked to resource file and will be localized automatically.if additional localization be needed ,say to verify the format of a postal code or telephone number ,you can define a locale-specfic formset element like this:
      <form name="testform" locale="fr" country="CA">...
      tiles:you can define xml file according to locale like resource file :
      tiles_fr_CA.xml
    posted on 2006-04-20 17:03 TrampEagle 閱讀(346) 評論(0)  編輯  收藏 所屬分類: 技術(shù)文摘
    主站蜘蛛池模板: 国产一卡二卡四卡免费| 亚洲精品视频久久久| 亚洲中文字幕成人在线| 亚洲综合在线一区二区三区| 一级看片免费视频| 四虎成人免费观看在线网址| 久久久无码精品亚洲日韩京东传媒| 免费一级特黄特色大片| 四虎www成人影院免费观看| 九九久久精品国产免费看小说| 久久精品国产亚洲av影院| 无码av免费一区二区三区| 亚洲天堂中文字幕在线| 91精品啪在线观看国产线免费| 久久精品夜色国产亚洲av| 国产免费爽爽视频在线观看| 亚洲午夜未满十八勿入网站2| 免费夜色污私人影院网站电影| 亚洲色偷偷偷网站色偷一区| 亚洲XX00视频| 免费久久人人爽人人爽av| 亚洲AV午夜成人影院老师机影院 | 国产亚洲精品91| 国产免费人视频在线观看免费| 亚洲国产成人精品无码区花野真一| 嫩草影院在线免费观看| 国内精品久久久久影院免费| 日韩精品免费一线在线观看| 亚洲人成影院77777| 大学生一级特黄的免费大片视频| 嫩草在线视频www免费看| 综合偷自拍亚洲乱中文字幕| 在线精品亚洲一区二区三区| 色欲国产麻豆一精品一AV一免费| 日亚毛片免费乱码不卡一区| 久久久亚洲精品视频| 青草草色A免费观看在线| 羞羞视频免费网站入口| 国产亚洲真人做受在线观看| 中文字幕无码免费久久99| 综合一区自拍亚洲综合图区|