You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/11/07 23:04:48 UTC
svn commit: r331614 - /struts/core/trunk/xdocs/userGuide/building_view.xml
Author: husted
Date: Mon Nov 7 14:04:47 2005
New Revision: 331614
URL: http://svn.apache.org/viewcvs?rev=331614&view=rev
Log:
Apply #37033 "Documentation fixes for building_view and building_model" submitted by Christian Meder. Thanks Christian!
Modified:
struts/core/trunk/xdocs/userGuide/building_view.xml
Modified: struts/core/trunk/xdocs/userGuide/building_view.xml
URL: http://svn.apache.org/viewcvs/struts/core/trunk/xdocs/userGuide/building_view.xml?rev=331614&r1=331613&r2=331614&view=diff
==============================================================================
--- struts/core/trunk/xdocs/userGuide/building_view.xml (original)
+++ struts/core/trunk/xdocs/userGuide/building_view.xml Mon Nov 7 14:04:47 2005
@@ -107,7 +107,7 @@
<li>
<a href="../struts-core/apidocs/org/apache/struts/util/MessageResources.html">
- <strong>MessageResources</strong></a> - The Struts class
+ <strong>MessageResources</strong></a> - The Struts Core class
<code>org.apache.struts.util.MessageResources</code> 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
@@ -118,11 +118,11 @@
</ul>
<p>
- Please note that the i18n support in a framework like Struts is limited to
+ Please note that the i18n support in a framework like Core is limited to
the <strong>presentation</strong> of internationalized text and images to the user.
Support for Locale specific <strong>input methods</strong> (used with languages
such as Japanese, Chinese, and Korean) is left up to the client device,
- whichis usually a web browser.
+ which is usually a web browser.
</p>
<p>
@@ -165,28 +165,15 @@
</ul>
<p>
- When you configure the controller servlet in the web application
- deployment descriptor, one of the things you will need to define in
- an initialization parameter is the base name of the resource bundle
- for the application.
+ When you configure the controller servlet via the struts-config.xml
+ configuration file, one of the things you will need to define is
+ the base name of the resource bundle for the application.
In the case described above, it would be
<code>com.mycompany.mypackage.MyApplication</code>.
</p>
<source><![CDATA[
-<servlet>
-<servlet-name>action</servlet-name>
-<servlet-class>
-org.apache.struts.action.ActionServlet
-</servlet-class>
-<init-param>
-<param-name>application</param-name>
-<param-value>
- com.mycompany.mypackage.MyResources
-</param-value>
-</init-param>
-<!-- ... -->
-</servlet>
+<message-resources parameter="com.mycompany.mypackage.MyApplication"/>
]]></source>
<p>
@@ -219,10 +206,10 @@
<p>
<strong>Note:</strong> While the examples given here use JSP and custom tags,
- the ActionForm beans and the other Struts controller components are
+ the ActionForm beans and the other Core controller components are
View neutral.
- Struts can be used with Cocoon, Velocity Templates, XSLT, and any other
- presentation technology that can be rendered via a Java servlet.
+ Struts Core can be used with Cocoon, Velocity Templates, XSLT, and
+ any other presentation technology that can be rendered via a Java servlet.
</p>
</subsection>
@@ -257,9 +244,10 @@
which is difficult to type correctly, confuses HTML developers who are
not knowledgeable about programming concepts, and can cause problems with
HTML editors.
- Instead, Struts provides a comprehensive facility for building forms,
+ Instead, Struts Taglibs provides a comprehensive facility for
+ building forms,
based on the Custom Tag Library facility of JSP 1.1.
- The case above would be rendered like this using Struts:
+ The case above would be rendered like this using Struts Taglibs:
</p>
<source><![CDATA[
@@ -277,12 +265,12 @@
Most browsers support this through a <input type="file"> element,
that generates a file browse button, but it's up to the developer to
handle the incoming files.
- Struts handles these "multipart" forms in a way identical to building
+ Struts Core handles these "multipart" forms in a way identical to building
normal forms.
</p>
<p>
- For an example of using Struts to create a simple login form,
+ For an example of using Struts Core to create a simple login form,
see the "<a href="../faqs/actionForm.html">
Buiding an ActionForm Howto</a>".
</p>
@@ -292,8 +280,9 @@
<subsection name="3.3.2 Automatic Form Validation">
<p>
- In addition to the form and bean interactions described above, Struts
- offers an additional facility to validate the input fields it has received.
+ In addition to the form and bean interactions described above,
+ Struts Core offers an additional facility to validate the input
+ fields it has received.
To utilize this feature, override the following method in your ActionForm
class:
</p>
@@ -305,7 +294,7 @@
<p>
The <code>validate</code> method is called by the controller servlet after
- the bean properties have been populated, but before the corresponding
+ the bean properties have been populated, but before the corresponding
action class's <code>execute</code> method is invoked.
The <code>validate</code> method has the following options:
</p>
@@ -316,7 +305,8 @@
Perform the appropriate validations and find no problems -- Return
either <code>null</code> or a zero-length ActionErrors instance,
and the controller servlet will proceed to call the
- <code>perform</code> method of the appropriate <code>Action</code> class.
+ <code>execute</code> method of the appropriate
+ <code>Action</code> class.
</li>
<li>
@@ -347,14 +337,16 @@
</p>
<p>
- The Struts Validator, covered in the next section, may be used to easily
+ The Struts Core Validator, covered in the next section, may be
+ used to easily
validate ActionForms.
</p>
</subsection>
<a name="validator"/>
-<subsection name="3.3.3 The Struts Validator">
+<subsection name="3.3.3 The Struts Core Validator">
+
<p>
Configuring the Validator to perform form validation is easy.
@@ -362,7 +354,7 @@
<ol>
<li>
- The ActionForm bean must extend ValidatorForm
+ The ActionForm bean must extend ValidatorForm.
</li>
<li>
The form's JSP must include the
@@ -406,7 +398,7 @@
</p>
<p>
- For more about the Struts Validator, see the
+ For more about the Struts Core Validator, see the
<a href="./dev_validator.html">Developers Guide</a>.
</p>
@@ -418,7 +410,7 @@
<p>
Although the look and feel of your application can be completely
constructed based on the standard capabilities of JSP and Struts
- Taglib, you should consider employing other techniques that
+ Taglibs, you should consider employing other techniques that
will improve component reuse, reduce maintenance efforts, and/or reduce
errors.
Several options are discussed in the following sections.
@@ -430,10 +422,11 @@
<subsection name="3.4.1 Application-Specific Custom Tags">
<p>
- Beyond using the custom tags provided by Struts Taglib, it is easy
+ Beyond using the custom tags provided by Struts Taglibs, it is easy
to create tags that are specific to the application you are building, to
assist in creating the user interface. The MailReader example application included with
- Struts illustrates this principle by creating the following tags unique to
+ Struts Classic illustrates this principle by creating the
+ following tags unique to
the implementation of this application:
</p>
@@ -446,7 +439,7 @@
checkLogon tag is simply meant to demonstrate writing your own custom tags.) </li>
<li><strong>linkSubscription</strong> - Generates a hyperlink to a details page
for a Subscription, which passes the required primary key values as
- request attributes. This is used when listing the subscriptions associated
+ request attributes. This is used when listing the subscriptions associated
with a user, and providing links to edit or delete them.</li>
<li><strong>linkUser</strong> - Generates a hyperlink to a details page
for a User, which passes the required primary key values as
@@ -454,8 +447,10 @@
</ul>
<p>
- The source code for these tags is in the <code>src/example</code> directory,
- in package <code>org.apache.struts.example</code>, along with the other Java
+ The source code for these tags is in the <code>shared/src/java</code>
+ directory of the Applications subpackage,
+ in package <code>org.apache.struts.apps.mailreader.taglib</code>,
+ along with the other Java
classes that are used in this application.
</p>
</subsection>
@@ -467,7 +462,7 @@
Creating the entire presentation of a page in one JSP file (with custom
tags and beans to access the required dynamic data) is a very common
design approach, and was employed in the example application included
- with Struts.
+ with Struts Classic.
However, many applications require the display of multiple logically
distinct portions of your application together on a single page.
</p>
@@ -485,7 +480,7 @@
<li>
One or more "news feed" displays, with the topics of interest
- customizedfrom the user's registration profile.
+ customized from the user's registration profile.
</li>
<li>
@@ -505,9 +500,9 @@
segments.
Then, you can use the <em>include</em> capability of JavaServer Pages
technology to combine the results into a single result page, or use the
- include tag provided with Struts.
- There are three types of <em>include</em> available, depending on when you w
- ant the combination of output to occur:
+ include tag provided with Struts Taglibs.
+ There are three types of <em>include</em> available, depending on
+ when you want the combination of output to occur:
</p>
<ul>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org