husted      01/11/21 08:12:18

  Modified:    doc/userGuide Tag: STRUTS_1_0_BRANCH volunteers.xml
                        introduction.xml index.xml building_view.xml
                        building_model.xml building_controller.xml
  Log:
  Update documentation in anticipation of release candidate.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +12 -2     jakarta-struts/doc/userGuide/volunteers.xml
  
  Index: volunteers.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/volunteers.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- volunteers.xml    2001/06/15 01:45:27     1.1.2.1
  +++ volunteers.xml    2001/11/21 16:12:18     1.1.2.2
  @@ -32,6 +32,7 @@
   <li>Martin Cooper</li>
   <li>Mike Schachter</li>
   <li>Niall Pemberton</li>
  +<li>Oleg V Alexeev</li>
   <li>Ralph Schaer</li>
   <li>Rob Leland</li>
   <li>Sean Kelly</li>
  @@ -45,12 +46,15 @@
   <li>Craig R. McClanahan</li>
   <li>David Geary</li>
   <li>dIon Gillard</li>
  +<li>Ed Burns</li>
   <li>Eric Wu</li>
   <li>John Rousseau</li>
  +<li>John Ueltzhoeffer</li>
   <li>Larry McCay</li>
   <li>Martin Cooper</li>
   <li>Matthias Kerkhoff</li>
   <li>Mike Schachter</li>
  +<li>Paul Runyan</li>
   <li>Robert Hayden</li>
   <li>Stanley Santiago</li>
   <li>Ted Husted</li>
  @@ -61,18 +65,20 @@
   <section name="Active Committers" href="committers"> 
   <ul>
   <li><b>Craig R. McClanahan</b></li> (craigmcc at apache.org)
  -<li><b>David Geary</b></li>         (dgeary at apache.org)
   <li><b>Michael Schachter</b></li>   (mschachter at apache.org)
   <li><b>Ted Husted</b></li>          (husted at apache.org)
   <li><b>Rob Leland</b></li>          (rleland at apache.org)
   <li><b>Vincent Massol</b></li>      (vmassol at apache.org)
   <li><b>Cedric Dumoulin</b></li>     (cedric.dumoulin at lifl.fr)
   <li><b>Martin Cooper</b></li>       (martinc at apache.org)
  +<li><b>David Winterfeldt</b></li>   (dwinterfeldt at apache.org)
  +<li><b>Oleg Alexeev</b></li>        (oalexeev at apache.org)
   </ul>
   </section>
   
   <section name="Emeritus Committers" href="comitters.emeritus"> 
   <ul>
  +<li>David Geary</li>
   <li>Luis Arias</li>
   <li>Pierre Delilse</li>
   </ul>
  @@ -267,5 +273,9 @@
   questions too. Now, I'm glad to be able to give something back to the 
   Struts community by helping others understand, and also by contributing 
   ideas and code to help make Struts even better than it already is.</p>
  +
  +</section></chapter>
  +
  +  <p>Next: <a href="../index.html">Struts Home</a></p>
   
  -</section></chapter></body></document>
  +</body></document>
  
  
  
  1.1.2.6   +86 -58    jakarta-struts/doc/userGuide/introduction.xml
  
  Index: introduction.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/introduction.xml,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- introduction.xml  2001/10/19 05:52:40     1.1.2.5
  +++ introduction.xml  2001/11/21 16:12:18     1.1.2.6
  @@ -15,24 +15,37 @@
   
     <chapter name="1. Introduction" href="introduction">
   
  -      <section name="1.1 Preface: Forward into the Past! (or a brief history of 
Struts)" href="preface">
  -
  +      <section name="1.0 Prerequisites" href="prereqs">
           <p>
  -          Before getting started, you should know the basics of the following
  -          technologies:
  -        </p>
  +          This User Guide is written for active Web developers, and assumes a 
working 
  +          knowledge about how Java Web applications work. Before getting started, 
you should 
  +          understand the basics of these core technologies:
  +        </p>
  +
  +    <ul>
  +      <li><b>The HTTP Request/Response sequence.</b><br/>The canonical source for 
this
  +        is <a href="http://www.ietf.org/rfc/rfc2616.txt?number=2616";>RFC 2616
  +        - Hypertext Transfer Protocol (HTTP/1.1)</a>.</li>
  +      <li><b>Java Servlets</b>.<br/> A good place to start is the
  +        <a href="http://java.sun.com/products/jsp/product.html";>Sun Servlet product 
page</a>
  +        and the <a href="http://java.sun.com/docs/books/tutorial/";>Sun Java 
Tutorials</a>.</li>
  +      <li><b>JavaServer Pages (JSP)</b>.<br/> Likewise, a good place to start is the
  +        <a href="http://java.sun.com/products/jsp/product.html";>Sun JSP product 
page</a> 
  +        and the <a href="http://java.sun.com/docs/books/tutorial/";>Sun Java 
Tutorials</a>.</li>
  +      <li><b>JavaBeans</b>.<br/>Many Struts classes are written as JavaBeans. 
  +      If you haven't worked with JavaBeans before, see the 
  +      <a href="http://java.sun.com/products/javabeans/";>Sun JavaBean product 
page</a> 
  +        and the <a href="http://java.sun.com/docs/books/tutorial/";>Sun Java 
Tutorials</a></li>
  +    </ul>
  +
  +       <p>If you've created Web applications on other platforms, you can probably 
follow along, 
  +         and then visit the above references as needed. These are core technologies 
that 
  +         will be used in nearly all Java Web development projects.
  +       </p>
   
  -     <ul>
  -       <li>The HTTP Request/Response sequence. The canonical source for this
  -         is <a href="http://www.ietf.org/rfc/rfc2616.txt?number=2616";>RFC 2616
  -         - Hypertext Transfer Protocol (HTTP/1.1)</a>.</li>
  -       <li>Java Servlets. A good place to start is the
  -         <a href="http://java.sun.com/products/servlet/technical.html#tutorials";>
  -         servlet tutorials</a>.</li>
  -       <li>JavaServer Pages (JSP). Again, a good place to start is the
  -         <a href="http://java.sun.com/products/jsp/technical.html#tutorials";>
  -         JSP tutorials</a>.</li>
  -     </ul>
  +     </section>
  +
  +      <section name="1.1 Preface: Forward into the Past! (or a brief history of 
Struts)" href="preface">
   
           <p>
             When Java servlets were first invented, many programmers quickly realized 
that they were a
  @@ -111,16 +124,21 @@
             <code>org.apache.struts.action.Action</code> subclasses provided by the
             Struts developer. When initialized, the controller parses a configuration
             resource file. The configuration resource defines (among other things)
  -          the action mappings for the application. The controller uses these
  -          mappings to turn HTTP requests into application actions.
  +          the <code>org.apache.struts.action.ActionMapping</code>s for an 
application. 
  +          The controller uses these mappings to turn HTTP requests into application 
actions.
           </p>
           
           <p>
  -          At a minimum, a mapping must specify (1) a request path and (2) the object
  -          type to act upon the request. The Action object can handle the request 
and respond 
  +          An ActionMapping will usually specify:</p>
  +        <ul>
  +          <li><b>a request path</b> (or "URI"),</li>
  +          <li>the <b>object type</b> (Action subclass) to act upon the request, 
</li>
  +          <li>and other properties as needed. </li>
  +        </ul>
  +        <p>The Action object can handle the request and respond 
             to the client (usually a Web browser), or indicate that control should be 
forwarded 
  -          to another action. For example, if a login succeeds, a loginAction object 
may wish 
  -          to forward control to a mainMenu action.
  +          elsewhere. For example, if a login succeeds, a login action may wish 
  +          to forward the request onto the mainMenu.
           </p>
         
           <p>
  @@ -133,11 +151,12 @@
           <p>
             An Action object can create a shopping cart bean, add an item to the
             cart, place the bean in the session collection, and then forward control 
to
  -          another action -- that may use a JSP to display the contents of the 
user's cart.
  +          another mapping. That mapping may use a JavaServer Page to display the 
contents of the user's cart.
             Since each client has their own session, they will each also have their 
own
             shopping cart. In a Struts application, most of the business logic can be
  -          represented using JavaBeans.
  -        </p>
  +          represented using JavaBeans. An Action can call the properties of a 
JavaBean 
  +          without knowing how it actually works. This encapsulates the business 
logic, 
  +          so that the Action can focus on error handling and where to forward 
control.</p>
           
           <p>
             JavaBeans can also be used to manage input forms. A key problem in 
designing
  @@ -146,7 +165,7 @@
             subclassing <code>org.apache.struts.action.ActionForm</code>, and easily 
store
             the data for an input form in these form beans. The bean is saved in one 
of the
             standard, shared context collections, so that it can be used by other 
objects,
  -          especially the Action object.
  +          especially an Action object.
           </p>
           
           <p>
  @@ -158,21 +177,21 @@
           
           <p>
             A Struts form bean is declared in the configuration resource, defined in 
a Java
  -          source file, and linked to an action mapping using a common property 
name. When
  -          a request calls for an action that uses a form bean, the controller 
servlet
  +          source file, and linked to an ActionMapping using a common property name. 
When
  +          a request calls for an Action that uses a form bean, the controller 
servlet
             either retrieves or creates the form bean, and passes it to the Action 
object.
  -          The action object can then check the contents of the form bean before its 
input
  +          The Action object can then check the contents of the form bean before its 
input
             form is displayed, and also queue messages to be handled by the form. When
             ready, the Action object can return control with a forwarding to its input
             form, usually a JSP. The controller can then respond to the HTTP request 
and
  -          direct the client to the Java Server Page.
  +          direct the client to the JavaServer Page.
           </p>
           
           <p>
             The Struts framework includes custom tags that can automatically populate
             fields from a form bean. The only thing most JavaServer Pages need to know
             about the rest of the framework is the proper field names and where to 
submit
  -          the form. Components like the messages set by the Action object can be 
output
  +          the form. Components like the messages queued by the Action can be output
             using a single custom tag. Other application-specific tags can also be 
defined
             to hide implementation details from the JSPs.
           </p>
  @@ -192,26 +211,36 @@
           </p>
           
           <p>
  -          For the simplest applications, an Action object can handle the business 
logic
  -          associated with a request. However, in most cases, an Action object 
should pass
  -          the request to another object, usually a JavaBean. To allow reuse on other
  -          platforms, business-logic JavaBeans should not refer to any Web 
application
  -          objects. The Action object should translate needed details from the HTTP 
request
  -          and pass those along to the business-logic beans as regular Java 
variables.
  +          For the simplest applications, an Action object may sometimes handle the 
business logic
  +          associated with a request. <b>However, in most cases, an Action object 
should 
  +          invoke another object, usually a JavaBean, to perform the actual business 
logic.</b> 
  +          This lets the Action focus on error handling and control flow, rather 
than 
  +          business logic. To allow  reuse on other platforms, business-logic 
JavaBeans should not refer to any Web 
  +          application objects. The Action object should translate needed details 
from the 
  +          HTTP request and pass those along to the business-logic beans as regular 
Java 
  +          variables.
           </p>
             
           <p>
  -          In a database application, the business-logic beans might connect to and
  -          query the database and return the result set back to the action's servlet 
... to
  -          be stored in a form bean ... and then displayed by the JSP. Neither the 
action's
  -          servlet nor the JSP need to know (or care) where the result set comes 
from.
  +          In a database application, for example: 
           </p>
  +
  +        <ul>
  +         <li>A business-logic bean will connect to and query the database,</li>
  +         <li>The business-logic bean returns the result to the Action,</li>
  +         <li>The Action stores the result in a form bean in the request,</li>
  +         <li>The JavaServer Page displays the result in a HTML form.</li>
  +         </ul>
  +
  +         <p>Neither the Action nor the JSP need to know (or care) from where 
  +         the result comes. They just need to know how to package and display it.
  +         </p>
           
           <p>
             The rest of this Users Guide explains the various Struts components in 
greater 
             detail. The Struts release also includes several Developer Guides 
covering 
             various aspects of the frameworks, along with sample applications, 
  -          the standard JavaDoc API, and,  of course, the complete source code!
  +          the standard Javadoc API, and,  of course, the complete source code!
            </p>
            
            <p>
  @@ -239,7 +268,7 @@
           these beans may be self contained (and know how to save their state
           information persistently somehow), or they may be facades that know
           how to retrieve information from external sources (such as a database)
  -        when it is requested.  Entity Enterprise JavaBeans (EJBs) are also commonly
  +        when it is requested. Entity Enterprise JavaBeans (Entity EJBs) are also 
commonly
           used to represent internal state.
         </p>
           
  @@ -253,7 +282,7 @@
           that authorizes the user's credit card, and sends the order to the
           warehouse to be picked and shipped.  Other systems will represent the
           available actions separately, perhaps as Session Enterprise JavaBeans
  -        (EJBs).
  +        (Session EJBs).
         </p>
           
         <p>
  @@ -261,9 +290,9 @@
           actions might be embedded within the <code>Action</code> classes that are
           part of the Controller role.  This is appropriate when the logic is very
           simple, or where reuse of the business logic in other environments is not
  -        contemplated.  The Struts framework supports any of these approaches, but
  -        recommends separating the business logic ("what to do") from the role that
  -        <code>Action</code> classes play ("deciding what to do").
  +        contemplated. The Struts framework supports any of these approaches, but
  +        <b>strongly</b> recommends separating the business logic ("how it's done") 
  +        from the role that <code>Action</code> classes play ("what to do").
         </p>
       </section>
   
  @@ -276,7 +305,7 @@
           ability to insert dynamic content based on the interpretation (at page
           request time) of special action tags.  The JSP environment includes a
           set of standard action tags, such as <code>&lt;jsp:useBean&gt;</code>
  -        whose purpose is described in the JavaServer Pages Specification.  In
  +        whose purpose is described in the <a 
href="http://java.sun.com/products/jsp/download.html";>JavaServer Pages 
Specification</a>.  In
           addition, there is a standard facility to define your own tags, which
           are organized into "custom tag libraries."
         </p>
  @@ -307,13 +336,13 @@
           what business logic function is to be performed, and then delegating
           responsibility for producing the next phase of the user interface to
           an appropriate View component.  In Struts, the primary component of the
  -        Controller is a servlet of class <code>ActionServlet</code>.  This servlet
  -        is configured by defining a set of mappings (described by a Java class
  -        <code>ActionMapping</code>).  Each mapping defines a <code>path</code>
  -        that is matched against the request URI of the incoming request, and the
  -        fully qualified class name of an <code>Action</code> class (that is, a
  -        Java class extending the <code>Action</code> class) which is
  -        responsible for performing the desired business logic, and then dispatching
  +        Controller is a servlet of class <code>ActionServlet</code>. This servlet
  +        is configured by defining a set of <code>ActionMappings</code>. 
  +        An ActionMapping defines a <code>path</code> that is matched against the 
  +        request URI of the incoming request, and usually specifies the
  +        fully qualified class name of an Action class. All Actions
  +        are subclassed from <code>org.apache.struts.action.Action</code>. Actions 
  +        encapsulate the business logic, interpret the outcome, and ultimately 
dispatch
           control to the appropriate View component to create the response.
         </p>
           
  @@ -326,16 +355,15 @@
           control should be forwarded so that an action method can ask for the
           "Main Menu" page (for example), without knowing what the actual name of the
           corresponding JSP page is.  These features greatly assist you in separating
  -        the control logic (what do I do next) with the view logic (what is the name
  -        of the corresponding page).
  +        the control logic (what to do) with the view logic (how it's rendered).
         </p>
         
         <p align="center">
           Next: <a href="building_model.html">Building Model Components</a>
         </p>
         </section>
  -      
         
  +     
       </chapter>
       </body>
   </document>
  
  
  
  1.1.2.2   +1 -0      jakarta-struts/doc/userGuide/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/index.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- index.xml 2001/07/05 11:47:16     1.1.2.1
  +++ index.xml 2001/11/21 16:12:18     1.1.2.2
  @@ -18,6 +18,7 @@
           <ul>
               <li><a href="introduction.html">1. Introduction</a>
                   <ul>
  +                <li><a href="introduction.html#prereqs">1.0 Prerequisites</a></li>
                   <li><a href="introduction.html#preface">1.1 Preface: Forward into 
the Past!</a></li>
                   <li><a href="introduction.html#mvc">1.2 The Model-View-Controller 
('MVC') Design Pattern</a></li>
                   <li><a href="introduction.html#overview">1.3 Struts Framework 
Overview</a></li>
  
  
  
  1.1.2.5   +60 -26    jakarta-struts/doc/userGuide/building_view.xml
  
  Index: building_view.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/building_view.xml,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- building_view.xml 2001/10/19 05:52:40     1.1.2.4
  +++ building_view.xml 2001/11/21 16:12:18     1.1.2.5
  @@ -80,10 +80,11 @@
         </ul>
           
         <p>
  -        Please note that the i18n support in Struts is currently limited to the
  -        <b>presentation</b> of internationalized information to the user.
  -        Support for various Locale specific <b>input methods</b> is left up
  -        to the client device, which is usually a web browser.
  +        Please note that the i18n support in a framework like Struts is limited to 
the
  +        <b>presentation</b> of internationalized text and images to the user.
  +        Support for Locale specific <b>input methods</b> (used with languages 
  +        such as Japanese, Chinese, and Korean) is left up to the client device, 
which 
  +        is usually a web browser.
         </p>
   
         <p>
  @@ -138,13 +139,24 @@
           The important thing is for the resource bundle to be found on the 
           class path for your application. Another approach is to store 
           the <code>MyResources.properties</code> file in your application's 
  -        class folder. You can then simply specify "myResources" as the 
  -        application value.
  +        <code>classes</code> folder. You can then simply specify "myResources" as 
the 
  +        application value. Just be careful it is not deleted if your 
  +        build script deletes classes as part of a "clean" target.
         </p>
  +      <p>
  +        If it does, here is an Ant task to run when compiling your application 
  +        that copies the contents of a <code>src/conf</code>
  +        directory to the <code>classes</code> directory:
  +      </p>
  +       <pre>
  +        &lt;!-- Copy any configuration files -->
  +        &lt;copy todir="classes">
  +            &lt;fileset dir="src/conf"/>
  +        &lt;/copy>
  +       </pre>
       </section>
   
  -    <section name="3.3 Forms and FormBean Interactions" href="form_beans">
  -    
  +    <section name="3.3 Forms and FormBean Interactions" href="form_beans">    
         <p>
           At one time or another, most web developers have built forms using
           the standard capabilities of HTML, such as the <code>&lt;input&gt;</code>
  @@ -189,8 +201,9 @@
           files. Struts handles these "multipart" forms in a way identical to 
           building normal forms. In the next section, we will cover using Struts to 
           create a simple login form, and also a simple mulitpart form. 
  -      </p>
  -    
  +      </p>   
  +      </section>
  +
         <section name="3.3.1 Building Forms With Struts" href="forms">
           
           <p>
  @@ -366,9 +379,9 @@
   </pre>
   <hr/>        
           <p>
  -          Look at the <a href="../api/index.html">javadocs</a> for FormFile to see 
the
  +          Look at the <a href="../api/index.html">Javadocs</a> for FormFile to see 
the
             methods it exposes to manipulate files in file uploading.  Also look at 
the
  -          javadocs for ActionServlet and ActionMapping for the various parameters
  +          Javadocs for ActionServlet and ActionMapping for the various parameters
             you can specify to change how files are uploaded.  Basically in your
             peform() method in your action class you would call <code>((UploadForm) 
form).getMyFile()</code>
             to retrieve the FormFile and do what you want with it.
  @@ -440,7 +453,6 @@
                 specified request parameter, and defines the result as a page scope 
attribute of
                 type String or String[].</li>
           </ul>
  -        
         </section>
         
         <section name="3.3.4 Automatic Form Validation" href="form_validation">    
  @@ -485,12 +497,16 @@
             will assume that any required validation is done by the action class.
           </p>
           <p>
  -          One common approach is to perform simple validations using the validate() 
method, and 
  -          also provide further "business logic" validation as part of your Action 
object. 
  +          One common approach is to perform simple, prima facia validations using 
the 
  +          ActionForm validate() method, and then handle the "business logic" 
validation 
  +          from the Action. 
           </p>
  -
  +        <p>
  +          An optional package for performing ActionForm validations is available in 
the 
  +          Nightly Build and from <a href="http://home.earthlink.net/~dwinterfeldt/";>
  +          David Winterfeldt's Web site</a>.
  +        </p>
         </section>
  -    </section>
       
       <section name="3.4 Other Presentation Techniques" href="other_presentations">
       
  @@ -501,6 +517,7 @@
           reuse, reduce maintenance efforts, and/or reduce errors.  Several options
           are discussed in the following sections.
         </p>
  +    </section>
         
         <section name="3.4.1 Application-Specific Custom Tags" href="custom_tags">
         
  @@ -569,9 +586,9 @@
             
           <ul>
             <li>An <code>&lt;%@ include file="xxxxx" %&gt;</code> directive can 
include a file that contains
  -          java code or jsp tags. The code in the included file can even reference
  +          Java code or JSP tags. The code in the included file can even reference
             variables declared earlier in the outer jsp page. The code is inlined into
  -          the other jsp before it is compiled so it can definately contain more than
  +          the other JavaServer Page before it is compiled so it can definately 
contain more than
             just HTML.</li>
             <li>The include <i>action</i> (<code>&lt;jsp:include page="xxxxx"
                 flush="true" /&gt;</code>) is processed at request time, and is 
handled
  @@ -588,6 +605,12 @@
             Another approach to this would be to use the Struts Template Tag library. 
See the         
             Developer's Guide for details.
           </p>  
  +        <p>
  +          Tiles is an alternative to the original Template Tag library, offering 
several 
  +          enhancements and new capabilities. Tiles is available in the 
  +          Nightly Build, and from <a href="http://www.lifl.fr/~dumoulin/tiles/";>
  +          Cedric Dumoulin's Web site</a>.
  +        </p>
         </section>
   
         <section name="3.4.3 Image Rendering Components" href="image_rendering">
  @@ -610,16 +633,27 @@
                 can have the applet make its own connection to the server to receive
                 these parameters.</li>
           </ul>
  -      
  +      </section>
  +
  +      <section name="3.4.4 Rendering Text" href="text_rendering">
  +
  +         <p>
  +           Some applications require dynamically generated text or markup, 
  +           such as XML. If a complete page is being rendered, and can be output 
  +           using a PrintWriter, this is very easy to do from an Action:
  +         </p>
  +         <pre>
  +           response.setContentType("text/plain"); // or text/xml
  +           PrintWriter writer = response.getWriter();
  +           // use writer to render text
  +           return(null);
  +         </pre>
  +
           <p align="center">
             Next: <a href="building_controller.html">Building Controller 
Components</a>
           </p>
         </section>
  -    </section>
  +
     </chapter>
     </body>
  -</document> 
  -  
  -
  -
  -
  +</document> 
  \ No newline at end of file
  
  
  
  1.1.2.3   +17 -2     jakarta-struts/doc/userGuide/building_model.xml
  
  Index: building_model.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/building_model.xml,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- building_model.xml        2001/10/19 05:52:40     1.1.2.2
  +++ building_model.xml        2001/11/21 16:12:18     1.1.2.3
  @@ -85,7 +85,7 @@
           than the <i>Model</i>.
         </p>
         <p>
  -        The Struts framework generally assumes that you have created an
  +        The Struts framework generally assumes that you have defined an
           <code>ActionForm</code> bean (that is, a Java class extending the
           <code>ActionForm</code> class) for each input form required in your
           application. <code>ActionForm</code> beans are sometimes just called
  @@ -135,12 +135,22 @@
               to the usual JavaBeans conventions.  For example, an input field named
               <code>username</code> will cause the <code>setUsername()</code> method
               to be called.</li>
  +        <li>Think of your ActionForm beans as a firewall between HTTP and the 
Action. 
  +            Use the validate method to ensure all required properties are present, 
and 
  +            that they contain reasonable values. An ActionForm that fails 
validation 
  +            will not even be presented to the Action for handling.</li>
           <li>You may also place a bean instance on your form, and use nested 
property 
               references. For example, you might have a "customer" bean on your 
Action 
               Form, and then refer to the property "customer.name" in your JSP view. 
               This would correspond to the methods <code>customer.getName()</code> 
and 
               <code>customer.setName(string Name)</code> on your customer bean. See 
the 
               Tag Library Developer Guides for more about nested syntax.</li>
  +        <li><i>Caution:</i> If you nest an existing bean instance on your form, 
think 
  +            about the properties it exposes. Any public property on an ActionForm 
that 
  +            accepts a single String value can be set with a query string. It may be 
  +            useful to place such beans inside a thin "wrapper" that exposes only 
the 
  +            properties required. This wrapper can also provide a filter to be 
  +            sure runtime properties are not set to inappropriate values.</li> 
         </ul>
           
         <p>
  @@ -222,7 +232,7 @@
         
         <p>
           Struts can define the datasources for an application from within its 
standard 
  -        configuration file. A simple JDBC connection pool is also provided. See <a 
  +        configuration file. A <b>simple</b> JDBC connection pool is also provided. 
See <a 
           href="building_controller.html#config">The Action Mappings Configuration 
File</a>
           section and the Utilities Developer Guide for details. 
         </p>
  @@ -259,6 +269,11 @@
   }
   </pre>
         
  +      <p>
  +        Note that the Struts generic connection pool is an <b>optional</b> 
component. Many 
  +        Struts applications use other connection pools for better performance, 
  +        especially with high-volume production systems. 
  +       </p>
         <p align="center">
           Next: <a href="building_view.html">Building View Components</a>
         </p>
  
  
  
  1.1.2.4   +31 -24    jakarta-struts/doc/userGuide/building_controller.xml
  
  Index: building_controller.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/building_controller.xml,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- building_controller.xml   2001/11/04 05:55:23     1.1.2.3
  +++ building_controller.xml   2001/11/21 16:12:18     1.1.2.4
  @@ -24,14 +24,10 @@
         </p>
         
         <ul>
  -        <li>Write an <code>Action</code> class (that is, an extension of the
  -            <code>Action</code> class) for each logical request
  -            that may be received.</li>
  -        <li>[Optionally] Write an <code>ActionMapping</code> class (that is, an
  -           extension of the <code>ActionMapping</code> class) that defines the class
  -           names and other information associated with each possible mapping.</li>
  -        <li>Write the action mapping configuration file (in XML) that is used
  -            to configure the controller servlet. This file is usually named
  +        <li>Write an <code>Action</code> class for each logical request that may 
  +            be received (extend <code>org.apache.action.Action</code>).</li>
  +        <li>Configure a ActionMapping (in XML) for each logical request that may 
  +            be submitted. The XML configuration file is usually named
               <code>struts-config.xml</code>.</li>
           <li>Update the web application deployment descriptor file (in XML)
               for your application to include the necessary Struts components.</li>
  @@ -60,31 +56,31 @@
   </pre>
         
         <p>
  -        Most people would only use the "HttpServletRequest" version. 
  +        Most projects would only use the "HttpServletRequest" version. 
         </p>
         <p>
  -        The goal of an <code>Action</code> class is to process this request,
  -        and then to return an <code>ActionForward</code> object that identifies
  -        the JSP page (if any) to which control should be forwarded to generate
  -        the corresponding response.  In the <i>MVC/Model 2</i> design pattern,
  -        a typical <code>Action</code> class will implement the following
  -        logic in its <code>perform()</code> method:
  +        The goal of an <code>Action</code> class is to process a request, via 
  +        its <code>perform()</code> method, and return an <code>ActionForward</code> 
object 
  +        that identifies where control should be forwarded (e.g. a JSP) to provide 
  +        the appropriate response. In the <i>MVC/Model 2</i> design pattern,
  +        a typical <code>Action</code> class will often implement logic like the 
following
  +        in its <code>perform()</code> method:
         </p>
         <ul>
           <li>Validate the current state of the user's session (for example, checking
               that the user has successfully logged on).  If the <code>Action</code>
  -            class finds that no logon exists, the request should be forwarded to
  +            class finds that no logon exists, the request can be forwarded to
               the JSP page that displays the username and password prompts for
  -            logging on.  This could occur because a user tried to enter your
  +            logging on.  This could occur because a user tried to enter an 
               application "in the middle" (say, from a bookmark), or because the
               session has timed out, and the servlet container created a new one.</li>
  -        <li>If validation has not yet occurred,
  -            validate the form bean properties as necessary.  If a problem is found,
  +        <li>If validation is not complete,
  +            validate the form bean properties as needed.  If a problem is found,
               store the appropriate error message keys as a request attribute, and
               forward control back to the input form so that the errors can be
               corrected.</li>
           <li>Perform the processing required to deal with this request (such as
  -            saving a row into a database).  This can be done by code embedded within
  +            saving a row into a database).  This can be done by logic code embedded 
within
               the <code>Action</code> class itself, but should generally be performed
               by calling an appropriate method of a business logic bean.</li>
           <li>Update the server-side objects that will be used to create the next
  @@ -140,6 +136,12 @@
           it is embedded inside a component (the <code>Action</code> class) that
           is tied to being executed in a web application environment.
         </p>
  +
  +      <p>
  +        An <code>Action</code> can be factored into several local methods, so long 
as all 
  +        properties needed are passed in the method signatures. The JVM 
  +        handles such properties using the stack, and so they are thread-safe. 
  +      </p>
           
         <p>
           The example application included with Struts stretches this design
  @@ -167,7 +169,6 @@
             that this action will use</li>
           <li><b>path</b> - The request URI path that is matched to select this
               mapping.  See below for examples of how matching works.</li>
  -            
           <li><b>unknown</b> - Set to <code>true</code> if this action
             should be configured as the default for this application, to handle
             all requests not handled by another action.  Only one action can be
  @@ -175,6 +176,10 @@
           <li><b>validate</b> - Set to <code>true</code> if the
             <code>validate()</code> method of the action associated
             with this mapping should be called.</li>
  +        <li><b>forward</b> - The request URI path to which control is passed 
  +         when his mapping is invoked. This is an alternative to declaring 
  +         a <b>type</b> property. </li>
  +
         </ul>
                  
       </section>
  @@ -551,7 +556,7 @@
           
           <p>
             Next, you must add an entry defining the Struts tag library.  There are 
currently four
  -          taglibs that struts is packaged with.
  +          taglibs that Struts is packaged with.
           </p>
           <p>
             The struts-bean taglib contains tags useful in accessing
  @@ -623,8 +628,10 @@
         <section name="4.5.4 Add Struts Components To Your Application" 
href="config_add">
           
           <p>
  -          To use struts, you must copy the .tld files that you require into your
  -          WEB-INF directory, and copy struts.jar into your WEB-INF/lib directory.
  +         To use Struts, you must copy the .tld files that you require into
  +         your <code>WEB-INF</code> directory, and copy <code>struts.jar</code>
  +         (and all of the <code>commons-*.jar</code> files) into your
  +         <code>WEB-INF/lib</code> directory.
           </p>
                                   <p>
                                           Next: <a href="resources.html">Struts 
Resources</a>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to