国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

3. Building View Components

2019-11-18 11:31:36
字體:
來源:轉載
供稿:網友

3. Building View Components

3.1 Overview

This chapter focuses on the task of building the View components for use with the Struts framework. Many applications rely on javaServer Pages (jsp) technology to create the PResentation layer. The Struts distribution includes a comprehensive JSP tag library that provides support for building internationalized applications, as well as for interacting with input forms. Several other topics related to the View components are briefly discussed.

3.2 Internationalized Messages

A few years ago, application developers could count on having to support only residents of their own country, who are used to only one (or sometimes two) languages, and one way to represent numeric quantities like dates, numbers, and monetary values. However, the eXPlosion of application development based on web technologies, as well as the deployment of sUCh applications on the Internet and other broadly accessible networks, have rendered national boundaries invisible in many cases. This has translated (if you will pardon the pun) into a need for applications to support internationalization (often called "i18n" because 18 is the number of letters in between the "i" and the "n") and localization.

Struts builds upon the standard classes available on the Java platform to build internationalized and localized applications. The key concepts to become familiar with are:

  • Locale - The fundamental Java class that supports internationalization is Locale. Each Locale represents a particular choice of country and language (plus an optional language variant), and also a set of formatting assumptions for things like numbers and dates.
  • ResourceBundle - The java.util.ResourceBundle class provides the fundamental tools for supporting messages in multiple languages. See the Javadocs for the ResourceBundle class, and the information on Internationalization in the documentation bundle for your JDK release, for more information.
  • PropertyResourceBundle - One of the standard implementations of ResourceBundle allows you to define resources using the same "name=value" syntax used to initialize properties files. This is very convenient for preparing resource bundles with messages that are used in a web application, because these messages are generally text oriented.
  • MessageFormat - The java.text.MessageFormat class allows you to replace portions of a message string (in this case, one retrieved from a resource bundle) with arguments specified at run time. This is useful in cases where you are creating a sentence, but the Words would appear in a different order in different languages. The placeholder string {0} in the message is replaced by the first runtime argument, {1} is replaced by the second argument, and so on.
  • MessageResources - The Struts class org.apache.struts.util.MessageResources lets you treat a set of resource bundles like a database, and allows you to request a particular message string for a particular Locale (normally one associated with the current user) instead of for the default Locale the server itself is running in.



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兰坪| 灵武市| 响水县| 岢岚县| 连云港市| 上犹县| 罗田县| 四会市| 桐柏县| 屯门区| 阳谷县| 沁水县| 南部县| 隆德县| 正安县| 古浪县| 长宁区| 武宣县| 什邡市| 衡南县| 陆河县| 新巴尔虎右旗| 宣威市| 渭南市| 辉县市| 平谷区| 田林县| 房产| 竹溪县| 开阳县| 拜城县| 汶上县| 富顺县| 绥江县| 鹤峰县| 北安市| 哈巴河县| 阿坝县| 弋阳县| 岚皋县| 灌云县|