You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Christian Meder <ch...@absolutegiganten.org> on 2005/09/27 00:30:21 UTC

[5/5] Minor fixes for Struts Core documentation

* substitute Struts with Struts Core
* correct user reference in processRoles
* remove reference to perform method of Action in processActionPerform
* add note that perform was removed in Struts 1.2
* reference the 1.3 dtd of struts-config
-- 
Christian Meder, email: chris@absolutegiganten.org

The Way-Seeking Mind of a tenzo is actualized 
by rolling up your sleeves.

                (Eihei Dogen Zenji)

Index: userGuide/building_controller.xml
===================================================================
--- userGuide/building_controller.xml	(revision 291028)
+++ userGuide/building_controller.xml	(working copy)
@@ -18,8 +18,8 @@
     Now that we understand how to construct the Model and View components
     of your application, it is time to focus on the <code>Controller</code>
     components.  
-    Struts includes a servlet that implements the primary function of mapping 
-    a request URI to an <code>Action</code> class.  
+    Struts Core includes a servlet that implements the primary function of 
+    mapping a request URI to an <code>Action</code> class.  
     Therefore, your primary responsibilities related to the Controller are:
     </p>
 
@@ -53,11 +53,11 @@
 
         <li>
         Update the web application deployment descriptor file (in XML)
-        for your application to include the necessary Struts components.
+        for your application to include the necessary Struts Core components.
         </li>
 
         <li>
-        Add the appropriate Struts components to your application.
+        Add the appropriate Struts Core components to your application.
         </li>
         
     </ul>
@@ -217,7 +217,7 @@
         <td>
         If the mapping has a role associated with it, ensure the requesting 
         user has the specified role.  
-        If they do not, raise an error and stop processing of the request.
+        If the user does not, raise an error and stop processing of the request.
         </td>
     </tr>
 
@@ -285,7 +285,7 @@
         <code>processActionPerform</code> 
         </td>
         <td>
-        This is the point at which your action's <code>perform</code> or 
+        This is the point at which your action's  
         <code>execute</code> method will be called.
         </td>
     </tr>
@@ -296,7 +296,7 @@
         </td>
         <td>
         Finally, the process method of the RequestProcessor takes the 
-        ActionForward returned by your Action class, and uses to select the 
+        ActionForward returned by your Action class, and uses it to select the 
         next resource (if any).
         Most often the ActionForward leads to the presentation page that
         renders the response.
@@ -315,7 +315,7 @@
     You will provide properties to hold the state of the form with getters 
     and setters to access them.  
     ActionForms can be stored in either the session (default) or request 
-    scopes.  
+    scope.  
     If they're in the session it's important to implement the form's 
     <code>reset</code> method to initialize the form before each use.  
     Struts sets the ActionForm's properties from the request parameters and 
@@ -344,7 +344,7 @@
     If you override a "stub" method, and provide error messages in the
     standard application resource, Struts will automatically validate the
     input from the form (using your method). 
-    See "<a href="./building_view.html#3_3_4_Automatic_Form_Validation">Automatic Form
+    See "<a href="building_view.html#3_3_4_Automatic_Form_Validation">Automatic Form
     Validation</a>" for details. Of course, you can also ignore the
     ActionForm validation and provide your own in the Action object.
     </li>
@@ -383,7 +383,7 @@
     For example, you might have a "customer" bean on your ActionForm, and 
     then refer to the property "customer.name" in your presentation page.
     This would correspond to the methods <code>customer.getName()</code> and
-    <code>customer.setName(string Name)</code> on your customer bean. 
+    <code>customer.setName(String name)</code> on your customer bean. 
     See the Tag Library Developer Guides for more about using nested syntax 
     with the Struts JSP tags.
     </li>
@@ -520,9 +520,9 @@
     </p>
     
     <p>
-    In JSP pages using the original Struts custom tags, attributes of
+    In JSP pages using the original Struts Classic custom tags, attributes of
     <code>DynaActionForm</code> objects can be referenced just like ordinary
-    <code>ActionForm</code> objects. Wherever a Struts tag refers to a
+    <code>ActionForm</code> objects. Wherever a Struts Classic tag refers to a
     "property", the tags will automatically use the DynaActionForm properties
     just like those of a conventional JavaBean.
     You can even expose DynaActionForm properties using bean:define.
@@ -531,8 +531,8 @@
     </p>
 
     <p>
-    If you are using the Struts JSTL EL taglib, the references are different,
-    however.
+    If you are using the Struts Classic JSTL EL taglib, the references are 
+    different, however.
     Only properties of ordinary <code>ActionForm</code> objects can be directly
     accessed through the JSTL expression language syntax.  
     The <code>DynaActionForm</code> properties must be accessed through a
@@ -575,7 +575,7 @@
     DynaActionForms cannot be instantiated using a no-argument constructor.
     In order to simulate the extra properties,
     there is a lot of machinery involved in their construction.
-    You must rely on Struts to instantiate a DynaActionForm for you,
+    You must rely on Struts Core to instantiate a DynaActionForm for you,
     via the ActionMapping.
     </p>
 
@@ -613,14 +613,14 @@
     <p>
     The DynaActionForm classes offer the ability to create ActionForm beans 
     at initialization time, based on a list of properties enumerated in the 
-    Struts configuration file. 
+    Struts Core configuration file. 
     However, many HTML forms are generated dynamically at request time. 
     Since the properties of these forms' ActionForm beans are not all known 
     ahead of time, we need a new approach.
     </p>
     
     <p>
-    Struts allows you to make one or more of your ActionForm's properties' 
+    Struts Core allows you to make one or more of your ActionForm's properties' 
     values a Map instead of a traditional atomic object. 
     You can then store the data from your form's dynamic fields in that Map. 
     Here is an example of a map-backed ActionForm class:
@@ -655,9 +655,9 @@
         </li>
 
         <li>
-        Struts should look for get/set methods that take a String key 
+        Struts Core should look for get/set methods that take a String key 
         parameter to find the correct sub-property value. 
-        Struts will, of course, use the <code>keyname</code> value from the 
+        Core will, of course, use the <code>keyname</code> value from the 
         parentheses when it calls the get/set methods.
         </li>
     
@@ -720,7 +720,7 @@
     <code>listname[index]</code>. 
     The braces in the bean property name indicate that the bean property named 
     <code>listname</code> is indexed (probably backed by a List), and that 
-    Struts should look for get/set methods that take an index parameter in 
+    Struts Core should look for get/set methods that take an index parameter in 
     order to find the correct sub-property value.
     </p>
 
@@ -838,7 +838,8 @@
     deprecated.
     The Struts 1.1 method simply calls the new <code>execute</code> method 
     and wraps any <code>Exception</code> thrown as a 
-    <code>ServletException</code>.
+    <code>ServletException</code>. The <code>perform</code> method was 
+    removed in Struts 1.2.
     </p>
 
    </subsection>
@@ -905,7 +906,7 @@
         Now is your chance to deal with these application errors - in the 
         <code>Action</code> class.  
         If your application specific code throws expections you should catch these 
-        exceptions  in your Action class, log them in your application's log 
+        exceptions in your Action class, log them in your application's log 
         (<code>servlet.log("Error message", exception)</code>) and return the 
         appropriate ActionForward.
         </li>
@@ -925,20 +926,22 @@
     to another conceptual layer; 
     otherwise, you may be left with an inflexible application which can only 
     be accessed in a web-application environment.
-    Struts should be viewed as simply the <strong>foundation</strong> for implementing 
+    Struts Core should be viewed as simply the <strong>foundation</strong> for implementing 
     MVC in your applications. 
-    Struts provides you with a useful control layer, but it is not a fully 
+    Struts Core provides you with a useful control layer, but it is not a fully 
     featured platform for building MVC applications, soup to nuts.
     </p>
 
     <p>
-    The MailReader example application included with Struts stretches this design
+    The MailReader example application included with Struts Classic stretches 
+    this design
     principle somewhat, because the business logic itself is embedded in the
     <code>Action</code> classes. 
     This should be considered something of a bug in the design of the example,
-    rather than an intrinsic feature of the Struts architecture, or an 
+    rather than an intrinsic feature of the Struts Core architecture, or an 
     approach to be emulated.
-    In order to demonstrate, in simple terms, the different ways Struts can be
+    In order to demonstrate, in simple terms, the different ways Struts Core 
+    can be
     used, the MailReader application does not always follow best practices.
     </p>
       
@@ -953,7 +956,7 @@
     <code>org.apache.struts.action.ExceptionHandler</code> and override the 
     <code>execute</code> method.
     Your <code>execute</code> method should process the Exception and return 
-    an ActionForward object to tell Struts where to forward to next.  
+    an ActionForward object to tell Struts Core where to forward to next.  
     Then you configure your handler in struts-config.xml like this:
     </p>
     
@@ -1125,7 +1128,7 @@
     
     <p>
     PlugIns are configured using &lt;plug-in&gt; elements within the
-    Struts configuration file. 
+    Struts Core configuration file. 
     See <a href="configuration.html#5_2_3_PlugIn_Configuration">PlugIn Configuration</a> 
     for details.
     </p>
@@ -1135,7 +1138,7 @@
 <subsection name="4.7 The ActionMapping Implementation">
 
     <p>
-    In order to operate successfully, the Struts controller servlet needs
+    In order to operate successfully, the Struts Core controller servlet needs
     to know several things about how each request URI should be mapped to an
     appropriate <code>Action</code> class.  
     The required knowledge has been encapsulated in a Java class named 
@@ -1191,7 +1194,8 @@
     It would be possible (but tedious) to write a small Java class that simply
     instantiated new <code>ActionMapping</code> instances, and called all of
     the appropriate setter methods.  
-    To make this process easier, Struts uses the Jakarta Commons Digester component
+    To make this process easier, Struts Core uses the Jakarta Commons 
+    Digester component
     to parse an XML-based description of the desired mappings and create the 
     appropriate objects initialized to the appropriate default values.
     See the <a href="http://jakarta.apache.org/commons">Jakarta Commons 
@@ -1204,14 +1208,14 @@
     your application. 
     This format of this document is described by the Document Type Definition
     (DTD) maintained at
-    <a href="http://struts.apache.org/dtds/struts-config_1_2.dtd">
-    http://struts.apache.org/dtds/struts-config_1_2.dtd</a>.
+    <a href="http://struts.apache.org/dtds/struts-config_1_3.dtd">
+    http://struts.apache.org/dtds/struts-config_1_3.dtd</a>.
     This chapter covers the configuration elements that you will typically 
     write as part of developing your application.
     There are several other elements that can be placed in the 
     struts-config file to customize your application. 
     See "<a href="configuration.html">Configuring Applications</a>" for more 
-    about the other elements in the Struts configuration file. 
+    about the other elements in the Struts Core configuration file. 
     </p>
 
     <p>
@@ -1270,7 +1274,7 @@
     <strong>&lt;global-forwards&gt;</strong><br />
     This section contains your global forward definitions.  
     Forwards are instances of the ActionForward class returned from an 
-    ActionForm's <code>execute</code> method. 
+    Action's <code>execute</code> method. 
     These map logical names to specific resources (typically JSPs), allowing 
     you to change the resource without changing references to it throughout 
     your application.
@@ -1282,7 +1286,7 @@
     
         <li>
         <code>name</code>: The logical name for this forward.  
-        This is used in your ActionForm's <code>execute</code> method to 
+        This is used in your Action's <code>execute</code> method to 
         forward to the next appropriate resource. 
         Example: homepage
         </li>
@@ -1346,8 +1350,8 @@
     <p>
     For a complete description of the elements that can be used with the 
     <code>action</code> element, see the
-    <a href="http://struts.apache.org/dtds/struts-config_1_2.dtd">
-    Struts Configuration DTD</a> and the
+    <a href="http://struts.apache.org/dtds/struts-config_1_3.dtd">
+    Struts Core Configuration DTD</a> and the
     <a href="../struts-core/apidocs/org/apache/struts/action/ActionMapping.html">ActionMapping 
     documentation</a>.
     </p>
@@ -1451,7 +1455,7 @@
     </p>
 
     <p>
-    The Struts configuration file includes several other elements that you 
+    The Struts Core configuration file includes several other elements that you 
     can use to customize your application. 
     See "<a href="configuration.html">Configuring Applications</a>" for details.
     </p>
@@ -1482,7 +1486,8 @@
 <subsection name="4.10 Using Wildcards in ActionMappings">
 
     <p>
-    [Since Struts 1.2.0] As a Struts application grows in size, so will the number of action
+    [Since Struts 1.2.0] As a Struts Core application grows in size, so will
+    the number of action
     mappings. Wildcards can be used to combine similiar mappings into one
     more generic mapping.  
     </p>
@@ -1518,13 +1523,13 @@
     the URI matched by the wildcard will then be substituted into various 
     attributes of the action mapping and its action forwards replacing 
     <code>{1}</code>.
-    For the rest of the request, Struts will see the action mapping and its 
-    action forwards containing the new values.
+    For the rest of the request, Struts Core will see the action mapping 
+    and its action forwards containing the new values.
     </p>
    
     <p>
     Mappings are matched against the request in the order they appear in
-    the Struts configuration file. If more than one pattern matches the
+    the Struts Core configuration file. If more than one pattern matches the
     last one wins, so less specific patterns must appear before more
     specific ones. However, if the request URL can be matched against
     a path without any wildcards in it, no wildcard matching is performed
@@ -1607,8 +1612,8 @@
 
 <subsection name="4.11 Commons Logging Interface">
     <p>
-    Struts doesn't configure logging itself -- it's all done by
-    <a href="http://jakarta.apache.org/commons/">commons-logging</a> 
+    Struts Core doesn't configure logging itself -- it's all done by
+    <a href="http://jakarta.apache.org/commons/logging">commons-logging</a> 
     under the covers. 
     The default algorithm is a search:
     </p>
@@ -1642,9 +1647,9 @@
     </p>
     
     <p>
-    Because Struts uses commons-logging and, therefore, includes the necessary 
-    JAR files for <strong>you</strong> to use commons-logging, you've probably had the 
-    occasional fleeting thought, <em>"Should I use
+    Because Struts Core uses commons-logging and, therefore, includes the 
+    necessary JAR files for <strong>you</strong> to use commons-logging, 
+    you've probably had the occasional fleeting thought, <em>"Should I use
     commons-logging?"</em> 
     The answer (surprise!) depends on the requirements for your particular 
     project. 
@@ -1694,8 +1699,8 @@
     </p>
 
     <p>
-    For examples of using logging in Struts classes, see the
-    Action classes in the Struts MailReader example application.
+    For examples of using logging in Action classes, see the
+    Struts Classic MailReader example application.
     </p>
 
 </subsection>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org