⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package.html.svn-base

📁 MVC开源框架
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
<!--    $Id$    Licensed to the Apache Software Foundation (ASF) under one or more    contributor license agreements.  See the NOTICE file distributed with    this work for additional information regarding copyright ownership.    The ASF licenses this file to You under the Apache License, Version 2.0    (the "License"); you may not use this file except in compliance with    the License.  You may obtain a copy of the License at            http://www.apache.org/licenses/LICENSE-2.0       Unless required by applicable law or agreed to in writing, software    distributed under the License is distributed on an "AS IS" BASIS,    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    See the License for the specific language governing permissions and    limitations under the License.--><html><head>    <title>Package Documentation for org.apache.struts.util Package</title></head><body bgcolor="white">The Utilities package provides a variety of families of classes,to solve problems that are commonly encountered in building web applications.<br><br><a name="doc.Description"></a><div align="center">    <a href="#doc.Intro">[Introduction]</a>    <a href="#doc.Beans">[Beans]</a>    <a href="#doc.Utilities">[Servlet Utilities]</a>    <a href="#doc.Messages">[Message Resources]</a></div><hr><a name="doc.Intro"></a><h3>Introduction</h3><p>The Struts Utilities Package offers several families    of classes that assist in solving commonly encountered problems when    building    web applications. Most of the classes in this package do not rely on the    controller servlet framework, or the custom tag libraries, so they are    also    suitable for general Java application programming. The following families    are included:</p><ul>    <li><a href="#doc.Beans">Beans</a> - A small set of utility beans useful        for        encapsulating form elements.</li>    <li><a href="#doc.Utilities">Servlet Utilities</a> - A set of classes        useful        for working with servlet-related classes.</li>    <li><a href="#doc.Messages">Message Resources</a> - A family of classes        that        features access to internationalized message strings based on a        message        key coupled with a <code>java.util.Locale</code> object representing a        particular user's preferred language.</li></ul><hr><a name="doc.Beans"></a><h3>Beans</h3><p> The <code>ImageButtonBean</code> is a simple JavaBean to encapsulate the    request parameters sent for an HTML input element of type image. The    <code>LabelValueBean</code> is a simple JavaBean to represent label-value    pairs, especially useful for html option elements.</p><hr><a name="doc.Utilities"></a><h3>Servlet Utilities</h3><p> The <code>RequestUtils</code> is a general purpose utility methods    related to processing a servlet request. The <code>ResponseUtils</code>    is a general purpose utility methods related to generating a servlet    response. The <code>ServletContextWriter</code> is a PrintWriter    implementation that uses the logging facilities of a    <code>javax.servlet.ServletContext</code> to output its results.</p><hr><a name="doc.Messages"></a><h3>Message Resources</h3><h5>Background</h5><p>Modern applications often include the requirement to support multiple    languages, for users who prefer to interact in a language other than the    default language configured on the server platform. In addition, sentences    often need to be constructed, with dynamic content whose placement in the    message depends on the standard sentence structure in that particular    language.</p><p>The standard Java platform includes a family of classes    (<code>java.util.ResourceBundle</code>) designed to support looking up    message    strings based on a standard "key". The resource bundle classes    automatically    access a Java class (or properties file) that is named with a naming    convention that includes the Locale to which messages in that class (or    file)    pertain. However, this selection is based only on the default Locale of    the    server platform, and cannot be adjusted on a per-user basis as required    for an    internationalized web application.</p><p>Struts includes a family of classes    (<code>org.apache.struts.util.MessageResources</code>) that extends the    basic    approach to looking up message strings by key, allowing you to optionally    specify a Locale along with the key. In this way, you can build    applications    that let your users select which Locale they wish to operate within, and    then    look up messages in that language - using the same message keys no matter    what    language is selected.</p><p>In addition to supporting dynamic selection of a Locale for message lookup,    the <code>MessageResources</code> family of classes optionally allow you    to    specify up to four parameter replacement objects, which are used to    replace the    parameter placeholders "{0}" through "{3}" in the retrieved message. This    replacement uses the facilities of the standard Java    <code>java.text.MessageFormat</code> class, which supports many extended    formatting capabilities as well.</p><p>For more information about internationalized messages, consult the    following    resources in your Java Development Kit documentation bundle:</p><ul>    <li><em>Internationalization Info</em> - General information on Java's        standard        support for internationalized applications can be found at        <code>&lt;$JAVA_HOME/docs/guide/internat/index.html&gt;</code>.        The "Internationalization Overview" section includes useful        information        about Locales, localized resources, message formatting, and other        relevant topics.</li>    <li><em>Internationalization Tutorial</em> - The Java Language Tutorial        has a        comprehensive trail covering internationalization, available at:        <a href="http://java.sun.com/docs/books/tutorial/i18n/index.html">            http://java.sun.com/docs/books/tutorial/i18n/index.html</a>.</li>    <li><em>Javadoc APIs</em> - You will want to consult the Javadoc API        documentation for the following standard Java classes:        <ul>            <li><code>java.text.MessageFormat</code>            <li><code>java.util.ResourceBundle</code>            <li><code>java.util.PropertyResourceBundle</code>            <li><code>java.util.Properties</code> - See the documentation for                the                <code>load()</code> method for the valid syntax of properties                files                that you prepare.</li>        </ul></li></ul><h5>Using the Standard MessageResources Implementation</h5><p>The standard <code>MessageResources</code> implementation provided by the    Struts library uses Java properties files to initialize message strings,    in a    manner very similar to that supported by the    <code>java.util.PropertyResourceBundle</code> class. The following steps    are    required to use these facilities in your Java application.</p><p>First, prepare a Java properties file for each language (or Locale) in    which    you wish to support your messages. The filenames you use must conform to    the    naming convention for property resource bundles, as described in the    documentation referenced above. Be sure you use the same message keys in    each

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -