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

📄 preface.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The Struts User's Guide - Preface: Core Technologies</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Ted Husted" name="author" />
<meta content="Ed Burns" name="author" />
<meta content="Craig R. McClanahan" name="author" />
<link href="../struts.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="heading">
<a href="http://apache.org/">
<img id="asf_logo_wide" alt="The Apache Project" src="../images/asf_logo_wide.gif" />
</a>
<a href="http://struts.apache.org/">
<img id="struts-logo" alt="Struts Framework" src="../images/struts.gif" />
</a>
</div>
<!--end heading-->
<div id="content">
<div id="menu">

    
    
    <p>User Guide</p>
<ul>
      <li>
<a href="index.html">Table of Contents</a>
</li>
      <li>
<a href="preface.html">Preface</a>
</li>
      <li>
<a href="introduction.html">Introduction</a>
</li>
      <li>
<a href="building_model.html">Model Components</a>
</li>
      <li>
<a href="building_view.html">View Components</a>
</li>
      <li>
<a href="building_controller.html">Controller Components</a>
</li>
      <li>
<a href="configuration.html">Configuration</a>
</li>
      <li>
<a href="release-notes.html">Release Notes</a>
</li>
      <li>
<a href="installation.html">Installation</a>
</li>
    </ul>

    <p>Developer Guides</p>
<ul>
        <li>
<a href="dev_bean.html">Bean Tags</a>
</li>
        <li>
<a href="dev_html.html">HTML Tags</a>
</li>
        <li>
<a href="dev_logic.html">Logic Tags</a>
</li>
        <li>
<a href="dev_nested.html">Nested Tags</a>
</li>
        <li>
<a href="dev_tiles.html">Tiles Tags</a>
</li>
        <li>
<a href="dev_util.html">Utilities</a>
</li>
        <li>
<a href="dev_validator.html">Validator</a>
</li>
    </ul>

    <p>Quick Links</p>
<ul>
        <li>
<a href="../index.html">Welcome</a>
</li>
        <li>
<a href="index.html">User and Developer Guides *</a>
</li>
        <li>
<a href="../faqs/index.html">FAQs and HowTos</a>
</li>
    </ul>

<div class="authors">
<p>
<strong>Contributors</strong>
</p>
<ul>
<li>Ted Husted</li>
<li>Ed Burns</li>
<li>Craig R. McClanahan</li>
</ul>
</div>
</div>
<!--end menu-->
<div id="main">

  <h1>0. Preface: Core Technologies</h1>
<h2 id="suspects">0.1 The Usual Suspects</h2>
<div class="indent">

    <p>
      This User Guide is written for active web developers and assumes a working
      knowledge about how Java web applications are built. Before getting started, you should
      understand the basics of several core technologies:
    </p>

    <ul>
      <li>
<a href="#http">HTTP, HTML, and User Agents</a>
</li>
      <li>
<a href="#cycle">The HTTP Request/Response Cycle</a>
</li>
      <li>
<a href="#java">The Java Language and Application Frameworks</a>
</li>
      <li>
<a href="#javabeans">JavaBeans</a>
</li>
      <li>
<a href="#resources">Properties Files and  ResourceBundles</a>
</li>
      <li>
<a href="#servlets">Java Servlets</a>
</li>
      <li>
<a href="#jsp">JavaServer Pages and JSP Tag Libraries</a>
</li>
      <li>
<a href="#xml">Extensible Markup Language</a>
</li>
    </ul>

    <p>
    This chapter briefly defines each of these technologies but does not describe them in detail.
    For your convenience, links to further information are provided if you would like to learn more about a technology.
    </p>

    <p id="JavaWebServicesTutorial">If you are familiar with Java, but not these technologies,
    the best overall starting point is
    <a href="http://java.sun.com/webservices/docs/1.0/tutorial/index.html">
<strong>The Java Web Services Tutorial</strong>
</a>.
    This document is also available for download in
    <a href="http://java.sun.com/webservices/docs/1.0/tutorial/doc/JavaWSTutorial.pdf">PDF</a> format.
    </p>

    <p>If you've created web applications for other platforms, you may be able to follow along
    and visit the other references as needed. The core technologies used by Struts are
    also used by most other Java web development products, so the background information will be
    useful in any Java project.
    </p>

    <p id="jt">If you are not familiar with the Java language generally,
    then the best starting point is
    <a href="http://java.sun.com/docs/books/tutorial/index.html">
<strong>The Java Tutorial</strong>
</a>.
    This overlaps with the Java Web Services Tutorial in some places, but the two work well together.
    </p>

      <p>
          For more about building Java application in general, see the
          <a href="http://developer.java.sun.com/developer/onlineTraining/new2java/divelog/part1/toc.jsp">New to
          Java</a> tutorial.
      </p>

    </div>
<h2 id="http">0.2 HTTP, HTML and User Agents</h2>
<div class="indent">

    <p>The World Wide Web was built over the Hypertext Transfer Protocol
    (<a href="http://www.ietf.org/rfc/rfc2616.txt?number=2616">HTTP</a>) and the Hypertext Markup Language
    (<a href="http://www.w3.org/MarkUp/">HTML</a>). A User Agent, like a web browser, uses HTTP to request
     a HTML document. The browser then formats and displays the document to its user. HTTP is used to
    transport more than HTML, but HTML is the lingua franca of the Web and web applications. </p>

    <p>While building web applications, some Java developers will write their own HTML. Others leave that responsibility to the
    page designers.</p>

    <p>For more about HTTP, HTML, and User Agents, see:</p>

    <ul>
    <li>
<a href="http://www.w3.org/MarkUp/Guide/">
<strong>Getting started with HTML</strong>
</a> by Dave Raggett</li>
    <li>
<a href="http://java.sun.com/webservices/docs/1.0/tutorial/doc/HTTP.html#63796">
    <strong>HTTP Overview</strong>
</a> in the Java Web Services Tutorial.</li>
    <li>
<a href="http://www.rfc-editor.org/rfc/rfc2616.txt">
<strong>HTTP/1.1
        </strong>
</a> Specification</li>
    <li>
<a href="http://www.rfc-editor.org/rfc/rfc2617.txt">
<strong>HTTP
        Basic and Digest Authentication</strong>
</a> Specification</li>
    <li>
<a href="http://www.rfc-editor.org/rfc/rfc2109.txt">
<strong>State
        Management Mechanism</strong>
</a> Specification (Cookies)</li>
    </ul>
    </div>
<h2 id="cycle">0.3 The HTTP Request/Response cycle</h2>
<div class="indent">

    <p>A very important part of HTTP for the web developer is the request/response cycle. To use HTTP
    you have to make a request. A HTTP server, like a web server, is then obliged to respond. When you
    build your web application, you design it to react to a HTTP request by returning a HTTP response.
    Frameworks like Struts abstract much of these nuts and bolts, but it is important to understand
    what is happening behind the scenes. </p>

    <p>If you are not familiar with the HTTP request/response cycle, we <strong>strongly</strong> recommend the
    <a href="http://java.sun.com/webservices/docs/1.0/tutorial/doc/HTTP.html#63796">
    HTTP Overview</a> in the Java Web Services Tutorial.
    </p>

    </div>
<h2 id="java">0.4 The Java Language and Application Frameworks</h2>
<div class="indent">

    <p>Struts is written in the popular and versatile
    <a href="http://java.sun.com/docs/books/jls/first_edition/html/index.html">Java programming language</a>.
    Java is an object-orientated language, and Struts makes good use of many
    object-orientated techniques.  In addition, Java natively supports the
    concept of <em>threads</em>, which allows more than one task to be
    performed at the same time.  A good understanding of Java, and especially
    object-orientated programming (OOP) and threading, will help
    you get the most out of Struts and this User Guide. </p>

    <p>For more about Java and threads, see </p>

    <ul>
    <li>
<a href="http://java.sun.com/docs/books/tutorial/java/index.html">
<strong>Learning the Java Language</strong>
</a> in the Java Tutorial</li>
    <li>
<a href="http://java.sun.com/docs/books/tutorial/essential/threads/index.html">
        <strong>Threads: Doing Two or More Tasks At Once</strong>
</a> in the Java Language
        Tutorial</li>
    </ul>

    <p>Even if you have worked with Java and OOP before, it can also help to be aware of the
    programming challenges specific to creating and using application frameworks. For more about application
    frameworks, see the classic white papers</p>

    <ul>
    <li>
<a href="http://www.laputan.org/drc/drc.html">
<strong>Designing Reusable Classes</strong>
</a> by Ralph E. Johnson &amp; Brian Foote</li>
    <li>
<a href="http://www.cs.wustl.edu/~schmidt/CACM-frameworks.html">
<strong>Object-Oriented Application Frameworks</strong>
</a>
    by Mohamed Fayad and Douglas C. Schmidt</li>
    </ul>

    <p>These papers can be especially helpful if you are
    <a href="http://www.waferproject.org/index.html">fact-finding or reviewing</a>
    server-side
    <a href="http://directory.google.com/Top/Computers/Programming/Languages/Java/Server-Side/Libraries_and_Frameworks/">frameworks</a>.
    </p>

    </div>
<h2 id="javabeans">0.5 JavaBeans</h2>
<div class="indent">

    <p>Like many Java applications, most of the Struts objects are designed as
    <a href="http://java.sun.com/products/javabeans/">JavaBeans</a>. Following the JavaBean design patterns makes
    the Struts classes easier to use -- both by Java developers and by Java development tools. </p>

    <p>Although JavaBeans were first created for visual elements, these object design patterns have been found to
    be useful as the basis for any reusable component, like those used by the Struts framework.</p>

    <p>For more about JavaBeans, see:</p>

    <ul>
    <li>
<a href="http://java.sun.com/products/javabeans/docs/">
<strong>The
        JavaBeans Component Architecture Documentation</strong>
</a> page at
        <code>java.sun.com</code>, including a link to download the
        <a href="http://java.sun.com/products/javabeans/docs/spec.html">
        JavaBeans 1.01 Specification</a>
</li>
    <li>
<a href="http://java.sun.com/docs/books/tutorial/javabeans/index.html">
        <strong>The JavaBean Trail</strong>
</a> in the Java Tutorial</li>
    <li>
<a href="http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSPBeans.html">
        <strong>JavaBeans Components in JSP Pages</strong>
</a> in the Java Web Services Tutorial
        </li>
    </ul>

    </div>
<h2 id="reflection">0.5.1 Reflection and Introspection</h2>
<div class="indent">

    <p>
    Reflection is the process of determining which member fields and methods are available on an object.
    Introspection is a specialized form of reflection used  by the JavaBean API.
    Using Introspection, we can determine which methods of a JavaBean are intended to be accessed by other objects.
    (The getters and the  setters, for example.)
    </p>

    <p>
    The Struts framework uses Introspection to convert HTTP parameters into JavaBean properties and to populate HTML fields from JavaBean properties.
    This technique makes it easy to "roundtrip" properties between HTML forms and JavaBeans.
    </p>

    <p>
    For more about Reflection and Introspection, see
    </p>

    <ul>
    <li>
    <a href="http://java.sun.com/docs/books/tutorial/reflect/">The Reflection Trail</a>
    </li>
    <li>
    <a href="http://java.sun.com/products/javabeans/docs/spec.html">Chapter 8 of the JavaBeans API Specification</a>
    </li>
    </ul>

    </div>
<h2 id="Maps">0.5.2 Maps</h2>
<div class="indent">

    <p>
    JavaBeans store data as properties and may act on that data through other methods.
    JavaBeans are flexible and powerful objects but are not the only object that programmers use to store data.
    Another popular object is the Map [<code>java.util.Map</code>].
    A Map is a simple collection of name and value pairs.
    Maps are often used "behind the scenes" as a flexible way to store dynamic data.
    </p>

    </div>
<h2 id="dynabeans">0.5.3 DynaBeans</h2>
<div class="indent">

    <p>
    DynaBeans combine the extensibility of JavaBeans with the flexibility of a Map.
    Defining even the simplest JavaBean requires defining a new class and coding a field and two methods for each property.
    The properties of a DynaBean can be configured via an XML descriptor.

⌨️ 快捷键说明

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