Author: wsmoak
Date: Sun Aug 14 12:41:39 2005
New Revision: 232631
URL: http://svn.apache.org/viewcvs?rev=232631&view=rev
Log:
Updated docs to conform with Jakarta site2 format
- changed <section> to <subsection>
- changed <chapter> to <section>
- changed <pre><code> to <source>
- removed 'href' attributes from <section> and <subsection> tags
- changed anchors to match section names with underscores
Modified:
struts/site/trunk/xdocs/userGuide/building_controller.xml
struts/site/trunk/xdocs/userGuide/building_model.xml
struts/site/trunk/xdocs/userGuide/building_view.xml
struts/site/trunk/xdocs/userGuide/configuration.xml
Modified: struts/site/trunk/xdocs/userGuide/building_controller.xml
URL:
http://svn.apache.org/viewcvs/struts/site/trunk/xdocs/userGuide/building_controller.xml?rev=232631&r1=232630&r2=232631&view=diff
==============================================================================
--- struts/site/trunk/xdocs/userGuide/building_controller.xml (original)
+++ struts/site/trunk/xdocs/userGuide/building_controller.xml Sun Aug 14
12:41:39 2005
@@ -10,9 +10,9 @@
</properties>
<body>
-<chapter name="4. Building Controller Components" href="building_controller">
+<section name="4. Building Controller Components">
-<section name="4.1 Overview" href="overview">
+<subsection name="4.1 Overview">
<p>
Now that we understand how to construct the Model and View components
@@ -67,9 +67,9 @@
"<a href="configuration.html">Configuring Applications</a>" chapter.
</p>
-</section>
+</subsection>
-<section name="4.2 The ActionServlet" href="action_servlet">
+<subsection name="4.2 The ActionServlet">
<p>
For those of you familiar with MVC architecture, the ActionServlet
@@ -100,7 +100,7 @@
<p>
The Struts controller delegates most of this grunt work to the
- <a href="#request_processor">Request Processor</a> and Action classes.
+ <a href="#4_2_1_Request_Processor">Request Processor</a> and Action
classes.
</p>
<p>
@@ -134,9 +134,9 @@
same request and response.
</p>
-</section>
+</subsection>
-<section name="4.2.1 Request Processor" href="request_processor">
+<subsection name="4.2.1 Request Processor">
<p>
The RequestProcessor is where the majority of the core processing
@@ -305,9 +305,9 @@
</table>
-</section>
+</subsection>
-<section name="4.3 ActionForm Classes" href="action_form_classes">
+<subsection name="4.3 ActionForm Classes">
<p>
An ActionForm represents an HTML form that the user interacts with over
@@ -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#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>
@@ -401,9 +401,9 @@
</ul>
-</section>
+</subsection>
-<section name="4.3.1 DynaActionForm Classes" href="dyna_action_form_classes">
+<subsection name="4.3.1 DynaActionForm Classes">
<p>
Maintaining a separate concrete ActionForm class for each form in your
@@ -424,7 +424,7 @@
that stores a user's given and family names:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<form-bean
name="UserForm"
type="org.apache.struts.action.DynaActionForm">
@@ -437,7 +437,7 @@
type="java.lang.String"
initial="Smith"/>
</form-bean>
-]]></code></pre>
+]]></source>
<p>
The types supported by DynaActionForm include:
@@ -541,14 +541,14 @@
of an <code>ActionForm</code> goes like this:
</p>
-<pre><code>${formbean.prop}</code></pre>
+<source>${formbean.prop}</source>
<p>
The syntax for referencing a property of a <code>DynaActionForm</code>
would be:
</p>
-<pre><code>${dynabean.map.prop}</code></pre>
+<source>${dynabean.map.prop}</source>
<p>
The <code>map</code> property is a property of
@@ -606,9 +606,9 @@
<a href="http://www.niallp.pwp.blueyonder.co.uk/">LazyActionForm</a>.
</p>
-</section>
+</subsection>
-<section name="4.3.2 Map-backed ActionForms" href="map_action_form_classes">
+<subsection name="4.3.2 Map-backed ActionForms">
<p>
The DynaActionForm classes offer the ability to create ActionForm beans
@@ -626,7 +626,7 @@
Here is an example of a map-backed ActionForm class:
</p>
-<pre><code><![CDATA[public FooForm extends ActionForm {
+<source><![CDATA[public FooForm extends ActionForm {
private final Map values = new HashMap();
@@ -639,7 +639,7 @@
}
}
-]]></code></pre>
+]]></source>
<p>
In its corresponding JSP page, you can access objects stored in the
@@ -667,7 +667,7 @@
Here is a simple example:
</p>
-<pre><code><![CDATA[<html:text property="value(foo)"/>]]></code></pre>
+<source><![CDATA[<html:text property="value(foo)"/>]]></source>
<p>
This will call the <code>getValue</code> method on FooForm with a key
@@ -675,7 +675,7 @@
To create a form with dynamic field names, you could do the following:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<%
for (int i = 0; i < 10; i++) {
String name = "value(foo-" + i + ")";
@@ -685,7 +685,7 @@
<%
}
%>
-]]></code></pre>
+]]></source>
<p>
Note that there is nothing special about the name <code>value</code>.
@@ -700,7 +700,7 @@
You do so by creating indexed get/set methods on your bean:
</p>
-<pre><code><![CDATA[public FooForm extends ActionForm {
+<source><![CDATA[public FooForm extends ActionForm {
private final List values = new ArrayList();
@@ -712,7 +712,7 @@
return values.get(key);
}
}
-]]></code></pre>
+]]></source>
<p>
In your presentation pages, you access individual entries in a list-backed
@@ -732,16 +732,16 @@
The <code>validwhen</code> validator (since Struts 1.2.1) also does
not support map-backed ActionForms.
</p>
-</section>
+</subsection>
-<section name="4.4 Action Classes" href="action_classes">
+<subsection name="4.4 Action Classes">
<p>
The <code>Action</code> class defines two methods that could be
executed depending on your servlet environment:
</p>
-<pre><code>public ActionForward execute(ActionMapping mapping,
+<source>public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
@@ -752,7 +752,7 @@
HttpServletRequest request,
HttpServletResponse response)
throws Exception;
-</code></pre>
+</source>
<p>
Since the majority of Struts projects are focused on building web
@@ -841,9 +841,9 @@
<code>ServletException</code>.
</p>
- </section>
+ </subsection>
- <section name="4.4.1 Action Class Design Guidelines"
href="action_design_guide">
+ <subsection name="4.4.1 Action Class Design Guidelines">
<p>
Remember the following design guidelines when coding <code>Action</code>
@@ -942,9 +942,9 @@
used, the MailReader application does not always follow best practices.
</p>
-</section>
+</subsection>
-<section name="4.5 Exception Handler" href="exception_handler">
+<subsection name="4.5 Exception Handler">
<p>
You can define an ExceptionHandler to execute when an Action's
@@ -957,13 +957,13 @@
Then you configure your handler in struts-config.xml like this:
</p>
-<pre><code><![CDATA[<global-exceptions>
+<source><![CDATA[<global-exceptions>
<exception
key="some.key"
type="java.io.IOException"
handler="com.yourcorp.ExceptionHandler"/>
</global-exceptions>
-]]></code></pre>
+]]></source>
<p>
This configuration element says that
@@ -1100,9 +1100,9 @@
the exception to some data store.
</p>
-</section>
+</subsection>
-<section name="4.6 PlugIn Classes" href="plugin_classes">
+<subsection name="4.6 PlugIn Classes">
<p>
The <em>PlugIn</em> interface extends Action and so that applications can
@@ -1126,13 +1126,13 @@
<p>
PlugIns are configured using <plug-in> elements within the
Struts configuration file.
- See <a href="configuration.html#plugin_config"> PlugIn Configuration</a>
+ See <a href="configuration.html#5_2_3_PlugIn_Configuration">PlugIn
Configuration</a>
for details.
</p>
-</section>
+</subsection>
-<section name="4.7 The ActionMapping Implementation" href="actionmapping">
+<subsection name="4.7 The ActionMapping Implementation">
<p>
In order to operate successfully, the Struts controller servlet needs
@@ -1182,9 +1182,9 @@
</ul>
-</section>
+</subsection>
-<section name="4.8 Writing Action Mappings" href="config">
+<subsection name="4.8 Writing Action Mappings">
<p>
How does the controller servlet learn about the mappings you want?
@@ -1352,9 +1352,9 @@
documentation</a>.
</p>
-</section>
+</subsection>
-<section name="4.8.1 ActionMapping Example" href="action_mapping_example">
+<subsection name="4.8.1 ActionMapping Example">
<p>
Here's a mapping entry based on the MailReader example
@@ -1364,7 +1364,7 @@
Note that the entries for all the other actions are left out:
</p>
-<pre><code><![CDATA[<struts-config>
+<source><![CDATA[<struts-config>
<form-beans>
<form-bean
name="logonForm"
@@ -1388,7 +1388,7 @@
validate="true" />
</action-mappings>
</struts-config>
-]]></code></pre>
+]]></source>
<p>
First the form bean is defined.
@@ -1423,7 +1423,7 @@
"success" and/or "failure" forward as part of an action mapping.
</p>
-<pre><code><![CDATA[<!-- Edit mail subscription -->
+<source><![CDATA[<!-- Edit mail subscription -->
<action
path="/editSubscription"
type="org.apache.struts.webapp.example.EditSubscriptionAction"
@@ -1437,7 +1437,7 @@
name="success"
path="/subscription.jsp"/>
</action>
-]]></code></pre>
+]]></source>
<p>
Using just these two extra properties, the Action classes are almost
@@ -1456,9 +1456,9 @@
See "<a href="configuration.html">Configuring Applications</a>" for
details.
</p>
-</section>
+</subsection>
-<section name="4.9 Using ActionMappings for Pages"
href="module_config-use_actions">
+<subsection name="4.9 Using ActionMappings for Pages">
<p>
Fronting your pages with ActionMappings is <em>essential</em> when using
@@ -1477,9 +1477,9 @@
<pre><action path="/view" forward="/view.jsp"/></pre>
-</section>
+</subsection>
-<section name="4.10 Using Wildcards in ActionMappings"
href="action_mapping_wildcards">
+<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
@@ -1489,11 +1489,11 @@
<p>
The best way to explain wildcards is to show an example and walk through
how it works. This example modifies the previous mapping in the <a
- href="#action_mapping_example">ActionMapping Example</a> section to use
+ href="#4_8_1_ActionMapping_Example">ActionMapping Example</a> section to
use
wildcards to match all pages that start with <code>/edit</code>:
</p>
-<pre><code><![CDATA[<!-- Generic edit* mapping -->
+<source><![CDATA[<!-- Generic edit* mapping -->
<action
path="/edit*"
type="org.apache.struts.webapp.example.Edit{1}Action"
@@ -1507,7 +1507,7 @@
name="success"
path="/{1}.jsp"/>
</action>
-]]></code></pre>
+]]></source>
<p>
The "<code>*</code>" in the path attribute allows the mapping to match the
@@ -1603,9 +1603,9 @@
<li><code>path</code></li>
</ul>
-</section>
+</subsection>
-<section name="4.11 Commons Logging Interface" href="logging">
+<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>
@@ -1664,7 +1664,7 @@
Let's take a look:
</p>
-<pre><code>package com.foo;
+<source>package com.foo;
// ...
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -1681,7 +1681,7 @@
}
// ...
}
-</code></pre>
+</source>
<p>
The general idea is to instantiate a single logger per class and to
@@ -1698,14 +1698,14 @@
Action classes in the Struts MailReader example application.
</p>
-</section>
+</subsection>
-<section>
+<subsection>
<p class="right">
Next: <a href="./configuration.html">Configuring Applications</a>
</p>
-</section>
+</subsection>
-</chapter>
+</section>
</body>
</document>
Modified: struts/site/trunk/xdocs/userGuide/building_model.xml
URL:
http://svn.apache.org/viewcvs/struts/site/trunk/xdocs/userGuide/building_model.xml?rev=232631&r1=232630&r2=232631&view=diff
==============================================================================
--- struts/site/trunk/xdocs/userGuide/building_model.xml (original)
+++ struts/site/trunk/xdocs/userGuide/building_model.xml Sun Aug 14 12:41:39
2005
@@ -11,9 +11,9 @@
</properties>
<body>
-<chapter name="2. Building Model Components" href="building_model">
+<section name="2. Building Model Components">
-<section name="2.1 Overview" href="overview">
+<subsection name="2.1 Overview">
<p>
Many requirements documents used for building web applications focus on
@@ -30,9 +30,9 @@
and JSP is useful first.
</p>
-</section>
+</subsection>
-<section name="2.2 JavaBeans and Scope" href="javabeans">
+<subsection name="2.2 JavaBeans and Scope">
<p>
Within a web-based application, JavaBeans can be stored in (and accessed
@@ -99,9 +99,9 @@
</code>
</p>
-</section>
+</subsection>
-<section name="2.3 ActionForm Beans" href="actionform">
+<subsection name="2.3 ActionForm Beans">
<strong>Note:</strong> While ActionForm beans often have properties that
@@ -123,8 +123,8 @@
<p>
If you declare such beans in your Struts
- configuration file (see "<a href="building_controller.html#config">
- Building the Controller Components</a>"), the Struts controller servlet
+ configuration file (see "<a
href="building_controller.html#4_8_Writing_Action_Mappings">
+ Writing Action Mappings</a>"), the Struts controller servlet
will automatically perform the following services for you, before
invoking the appropriate <code>Action</code> method:
</p>
@@ -192,9 +192,9 @@
The framework doesn't care.
</p>
-</section>
+</subsection>
-<section name="2.4 System State Beans" href="system_state">
+<subsection name="2.4 System State Beans">
<p>
The actual state of a system is normally represented as a set of one or
@@ -222,9 +222,9 @@
applications.
</p>
-</section>
+</subsection>
-<section name="2.5 Business Logic Beans" href="business_logic">
+<subsection name="2.5 Business Logic Beans">
<p>
You should encapsulate the functional logic of your application as
@@ -266,14 +266,14 @@
<a href="../faqs/database.html">Accessing a Database HowTo</a>.
</p>
-</section>
+</subsection>
-<section>
+<subsection>
<p class="right">
Next: <a href="building_view.html">Building View Components</a>
</p>
-</section>
+</subsection>
-</chapter>
+</section>
</body>
</document>
Modified: struts/site/trunk/xdocs/userGuide/building_view.xml
URL:
http://svn.apache.org/viewcvs/struts/site/trunk/xdocs/userGuide/building_view.xml?rev=232631&r1=232630&r2=232631&view=diff
==============================================================================
--- struts/site/trunk/xdocs/userGuide/building_view.xml (original)
+++ struts/site/trunk/xdocs/userGuide/building_view.xml Sun Aug 14 12:41:39 2005
@@ -10,9 +10,9 @@
</properties>
<body>
-<chapter name="3. Building View Components" href="building_view">
+<section name="3. Building View Components">
-<section name="3.1 Overview" href="overview">
+<subsection name="3.1 Overview">
<p>
This chapter focuses on the task of building the <em>View</em> components
@@ -25,9 +25,9 @@
Several other topics related to the View components are briefly discussed.
</p>
-</section>
+</subsection>
-<section name="3.2 Internationalized Messages" href="i18n">
+<subsection name="3.2 Internationalized Messages">
<p>
A few years ago, application developers could count on having to support
@@ -163,7 +163,7 @@
<code>com.mycompany.mypackage.MyApplication</code>.
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
@@ -177,7 +177,7 @@
</init-param>
<!-- ... -->
</servlet>
-]]></code></pre>
+]]></source>
<p>
The important thing is for the resource bundle to be found on the
@@ -195,16 +195,16 @@
directory to the <code>classes</code> directory:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<!-- Copy any configuration files -->
<copy todir="classes">
<fileset dir="src/conf"/>
</copy>
-]]></code></pre>
+]]></source>
-</section>
+</subsection>
-<section name="3.3 Forms and FormBean Interactions" href="form_beans">
+<subsection name="3.3 Forms and FormBean Interactions">
<p>
<strong>Note:</strong> While the examples given here use JSP and custom
tags,
@@ -232,10 +232,10 @@
look like this (in JSP):
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<input type="text" name="username"
value="<%= loginBean.getUsername() >"/>
-]]></code></pre>
+]]></source>
<p>
which is difficult to type correctly, confuses HTML developers who are
@@ -246,9 +246,9 @@
The case above would be rendered like this using Struts:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<html:text property="username"/>;
-]]></code></pre>
+]]></source>
<p>
with no need to explicitly refer to the JavaBean from which the initial
@@ -271,10 +271,10 @@
Buiding an ActionForm Howto</a>".
</p>
-</section>
+</subsection>
-<section name="3.3.1 Indexed & Mapped Properties" href="indexed">
+<subsection name="3.3.1 Indexed and Mapped Properties">
<p>
Property references in JSP pages using the Struts framework can reference
@@ -296,9 +296,9 @@
href="../faqs/indexedprops.html"><em>Indexed Properties, Mapped Properties,
and Indexed Tags</em></a>.
</p>
-</section>
+</subsection>
-<section name="3.3.2 Input Field Types Supported" href="form_input">
+<subsection name="3.3.2 Input Field Types Supported">
<p>
Struts defines HTML tags for all of the following types of input fields,
@@ -360,9 +360,9 @@
the field knows what bean to use for initializing displayed values.
</p>
-</section>
+</subsection>
-<section name="3.3.3 Other Useful Presentation Tags" href="presentation_tags">
+<subsection name="3.3.3 Other Useful Presentation Tags">
<p>
There are several tags useful for creating presentations, consult the
@@ -418,9 +418,9 @@
</ul>
-</section>
+</subsection>
-<section name="3.3.4 Automatic Form Validation" href="form_validation">
+<subsection name="3.3.4 Automatic Form Validation">
<p>
In addition to the form and bean interactions described above, Struts
@@ -429,10 +429,10 @@
class:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
validate(ActionMapping mapping,
HttpServletRequest request);
-]]></code></pre>
+]]></source>
<p>
The <code>validate</code> method is called by the controller servlet after
@@ -482,9 +482,9 @@
validate ActionForms.
</p>
-</section>
+</subsection>
-<section name="3.3.5 The Struts Validator" href="validator">
+<subsection name="3.3.5 The Struts Validator">
<p>
Configuring the Validator to perform form validation is easy.
@@ -502,7 +502,7 @@
<li>
You must define the validation rules in an xml file like this:
-<pre><code><![CDATA[
+<source><![CDATA[
<form-validation>
<formset>
<form name="logonForm">
@@ -512,18 +512,18 @@
</form>
</formset>
</form-validation>
-]]></code></pre>
+]]></source>
The msg element points to the message resource key to use when generating the
error message.
</li>
<li>Lastly, you must enable the ValidatorPlugin in the struts-config.xml file
like this:
-<pre><code><![CDATA[
+<source><![CDATA[
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
-]]></code></pre>
+]]></source>
</li>
</ol>
@@ -540,9 +540,9 @@
<a href="./dev_validator.html">Developers Guide</a>.
</p>
-</section>
+</subsection>
-<section name="3.4 Other Presentation Techniques" href="other_presentations">
+<subsection name="3.4 Other Presentation Techniques">
<p>
Although the look and feel of your application can be completely
@@ -553,9 +553,9 @@
Several options are discussed in the following sections.
</p>
-</section>
+</subsection>
-<section name="3.4.1 Application-Specific Custom Tags" href="custom_tags">
+<subsection name="3.4.1 Application-Specific Custom Tags">
<p>
Beyond using the custom tags provided by the Struts library, it is easy
@@ -586,9 +586,9 @@
in package <code>org.apache.struts.example</code>, along with the other
Java
classes that are used in this application.
</p>
-</section>
+</subsection>
-<section name="3.4.2 Page Composition With Includes" href="includes">
+<subsection name="3.4.2 Page Composition With Includes">
<p>
Creating the entire presentation of a page in one JSP file (with custom
@@ -667,9 +667,9 @@
</ul>
-</section>
+</subsection>
-<section name="3.4.3 Page Composition With Tiles" href="Tiles">
+<subsection name="3.4.3 Page Composition With Tiles">
<p>
Tiles is a powerful templating library that allows you to construct views
@@ -682,28 +682,28 @@
Create a /layout/layout.jsp file that contains your app's common look
and
feel:
-<pre><code><![CDATA[
+<source><![CDATA[
<html>
<body>
<tiles:insert attribute="body"/>
</body>
</html>
-]]></code></pre>
+]]></source>
</li>
<li>
Create your /index.jsp homepage file:
-<pre><code><![CDATA[
+<source><![CDATA[
<h1>This is my homepage</h1>
-]]></code></pre>
+]]></source>
</li>
<li>
Create a /WEB-INF/tiles-defs.xml file that looks like this:
-<pre><code><![CDATA[
+<source><![CDATA[
<tiles-definitions>
<definition
name="layout"
@@ -716,32 +716,32 @@
value="/index.jsp"/>
</definition>
<tiles-definitions>
-]]></code></pre>
+]]></source>
</li>
<li>
Setup the TilesPlugin in the struts-config.xml file:
-<pre><code><![CDATA[
+<source><![CDATA[
<plug-in
className="org.apache.struts.tiles.TilesPlugin">
<set-property
property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
</plug-in>
-]]></code></pre>
+]]></source>
</li>
<li>
Setup an action mapping in struts-config.xml to point to your
homepage tile:
-<pre><code><![CDATA[
+<source><![CDATA[
<action
path="/index"
type="org.apache.struts.actions.ForwardAction"
parameter="homepage"/>
-]]></code></pre>
+]]></source>
</li>
</ol>
@@ -758,9 +758,9 @@
See the tiles-documentation webapp for in-depth examples.
</p>
- </section>
+ </subsection>
- <section name="3.4.4 Image Rendering Components" href="image_rendering">
+ <subsection name="3.4.4 Image Rendering Components">
<p>
Some applications require dynamically generated images, like the
@@ -791,9 +791,9 @@
</ul>
- </section>
+ </subsection>
- <section name="3.4.5 Rendering Text" href="text_rendering">
+ <subsection name="3.4.5 Rendering Text">
<p>
Some applications require dynamically generated text or markup,
@@ -802,16 +802,16 @@
PrintWriter, this is very easy to do from an Action:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
response.setContentType("text/plain"); // or text/xml
PrintWriter writer = response.getWriter();
// use writer to render text
return(null);
-]]></code></pre>
+]]></source>
-</section>
+</subsection>
- <section name="3.4.6 The Struts-EL Tag Library" href="struts-el">
+ <subsection name="3.4.6 The Struts-EL Tag Library">
<p>
The <strong>Struts-EL</strong> tag library is a contributed library in
@@ -827,17 +827,17 @@
attribute values. For instance, to print a message from a properties
file based on a resource key, you would use the
<code>bean:write</code> tag, perhaps like this:</p>
- <pre><code>
+ <source>
<![CDATA[<bean:message key='<%= stringvar %>'/>]]>
- </code></pre>
+ </source>
<p>
This assumes that <code>stringvar</code> exists as a JSP scripting
variable. If you're using the <strong>Struts-EL</strong> library, the
reference looks very similar, but slightly different, like this:</p>
- <pre><code>
+ <source>
<![CDATA[<bean-el:message key="${stringvar}"/>]]>
- </code></pre>
+ </source>
<p>
If you want to know how to properly use the <strong>Struts-EL</strong>
@@ -882,15 +882,15 @@
For more see, <a href="../faqs/struts-el.html">Struts-El Extension</a> in
the FAQ/HOWTO section.
</p>
-</section>
+</subsection>
-<section>
+<subsection>
<p class="right">
Next: <a href="building_controller.html">Building Controller
Components</a>
</p>
-</section>
+</subsection>
-</chapter>
+</section>
</body>
</document>
Modified: struts/site/trunk/xdocs/userGuide/configuration.xml
URL:
http://svn.apache.org/viewcvs/struts/site/trunk/xdocs/userGuide/configuration.xml?rev=232631&r1=232630&r2=232631&view=diff
==============================================================================
--- struts/site/trunk/xdocs/userGuide/configuration.xml (original)
+++ struts/site/trunk/xdocs/userGuide/configuration.xml Sun Aug 14 12:41:39 2005
@@ -6,9 +6,9 @@
</properties>
<body>
-<chapter name="5. Configuring Applications" href="config_apps">
+<section name="5. Configuring Applications">
-<section name="5.1 Overview" href="config-overview">
+<subsection name="5.1 Overview">
<p>
Before you can build an application, you need to lay a solid foundation.
@@ -18,13 +18,13 @@
and in the Web Application Deployment Descriptor.
</p>
- </section>
+ </subsection>
- <section name="5.2 The Struts configuration file" href="struts-config">
+ <subsection name="5.2 The Struts configuration file">
<p>
- The <a href="building_controller.html#config">Building Controller
- Components</a> chapter covered writing the <code><form-bean></code>
and
+ The <a href="building_controller.html#4_8_Writing_Action_Mappings">Writing
Action
+ Mappings</a> section covered writing the <code><form-bean></code> and
<code><action-mapping></code> portions of the Struts configuration
file.
These elements usually play an important role in the development of a
Struts application.
@@ -52,9 +52,9 @@
</ul>
- </section>
+ </subsection>
- <section name="5.2.1 Controller Configuration" href="controller_config">
+ <subsection name="5.2.1 Controller Configuration">
<p>
The <code><controller></code> element allows you to configure
@@ -220,15 +220,15 @@
altogether.
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<controller
processorClass="org.apache.struts.action.RequestProcessor"
contentType="text/html"/>;
-]]></code></pre>
+]]></source>
-</section>
+</subsection>
-<section name="5.2.2 Message Resources Configuration" href="resources_config">
+<subsection name="5.2.2 Message Resources Configuration">
<p>
Struts has built in support for internationalization (I18N).
@@ -274,11 +274,11 @@
<p>Example configuration:</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<message-resources
parameter="MyWebAppResources"
null="false" />
-]]></code></pre>
+]]></source>
<p>
This would set up a message resource bundle provided in the file
@@ -286,9 +286,9 @@
Missing resource keys would be displayed as '<em>???keyname???</em>'.
</p>
-</section>
+</subsection>
-<section name="5.2.3 PlugIn Configuration" href="plugin_config">
+<subsection name="5.2.3 PlugIn Configuration">
<p>
Struts PlugIns are configured using the <code><plug-in></code>
@@ -307,19 +307,17 @@
This is an example using the Tiles plugin:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property
property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
</plug-in>
-]]></code></pre>
+]]></source>
-</section>
+</subsection>
-<section
- name="5.3 Configuring your application for modules"
- href="dd_config_modules">
+<subsection name="5.3 Configuring Your Application for Modules">
<p>
Very little is required in order to start taking advantage of the Struts
@@ -343,9 +341,9 @@
</ol>
-</section>
+</subsection>
-<section name="5.3.1 Module Configuration Files" href="module_config-files">
+<subsection name="5.3.1 Module Configuration Files">
<p>
Back in Struts 1.0, a few "boot-strap" options were placed in the
<code>web.xml</code>
@@ -357,7 +355,7 @@
<p>
Since Struts 1.1, you have two options: you can list
- <a href="#dd_config_servlet">multiple struts-config files</a> as a
+ <a href="#5_4_1_Configure_the_ActionServlet_Instance">multiple
struts-config files</a> as a
comma-delimited list, or you can subdivide a larger application into
modules.
</p>
@@ -369,11 +367,9 @@
less contention when trying to modify it.
</p>
-</section>
+</subsection>
-<section
- name="5.3.2 Informing the Controller"
- href="module_config-inform_controller">
+<subsection name="5.3.2 Informing the Controller">
<p>
Since Struts 1.0, you listed your configuration file as an initialization
@@ -389,7 +385,7 @@
For example:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
...
<init-param>
<param-name>config</param-name>
@@ -400,7 +396,7 @@
<param-value>/WEB-INF/conf/struts-module1.xml</param-value>
</init-param>
...
-]]></code></pre>
+]]></source>
<p>
Here we have two modules.
@@ -421,14 +417,14 @@
<p>
If you'd like to vary where the pages for each module are stored,
- see the <a href="#controller_config">forwardPattern</a> setting for the
+ see the <a href="5_2_1_Controller_Configuration">forwardPattern</a>
setting for the
Controller.
</p>
-</section>
+</subsection>
-<section name="5.3.3 Switching Modules" href="module_config-switching">
+<subsection name="5.3.3 Switching Modules">
<p>
There are three approaches for switching from one module to another.
@@ -441,7 +437,7 @@
You can use <code>org.apache.struts.actions.SwitchAction</code> like so:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
...
<action-mappings>
<action path="/toModule"
@@ -449,30 +445,30 @@
...
</action-mappings>
...
-]]></code></pre>
+]]></source>
<p>
Now, to change to ModuleB, we would use a URI like this:
</p>
- <pre><code>
+ <source>
http://localhost:8080/toModule.do?prefix=/moduleB&page=/index.do
- </code></pre>
+ </source>
<p>
If you are using the "default" module as well as "named" modules (like
"/moduleB"),
you can switch back to the "default" module with a URI like this:
</p>
- <pre><code>
+ <source>
http://localhost:8080/toModule.do?prefix=&page=/index.do
- </code></pre>
+ </source>
<p>
Here's an example of a global forward:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<global-forwards>
<forward name="toModuleB"
contextRelative="true"
@@ -480,14 +476,14 @@
redirect="true"/>
...
</global-forwards>
-]]></code></pre>
+]]></source>
<p>
You could do the same thing with a local forward declared in an
ActionMapping:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<action-mappings>
<action ... >
<forward name="success"
@@ -497,44 +493,44 @@
</action>
...
</action-mappings>
- ]]></code></pre>
+ ]]></source>
<p>
Or, you can use
<code>org.apache.struts.actions.SwitchAction</code>:
</p>
- <pre><code><![CDATA[
+ <source><![CDATA[
<action-mappings>
<action path="/toModule"
type="org.apache.struts.actions.SwitchAction"/>
...
</action-mappings>
- ]]></code></pre>
+ ]]></source>
<p>
Now, to change to ModuleB, we would use a URI like this:
</p>
- <pre><code>
+ <source>
http://localhost:8080/toModule.do?prefix=/moduleB&page=/index.do
- </code></pre>
+ </source>
<p>
Using the module parameter with a hyperlink tag is even simpler:
</p>
- <pre><code><![CDATA[
+ <source><![CDATA[
<html:link module="/moduleB" path="/index.do"/>
- ]]></code></pre>
+ ]]></source>
<p>
That's all there is to it! Happy module-switching!
</p>
-</section>
+</subsection>
-<section name="5.4 The Web Application Deployment Descriptor" href="dd_config">
+<subsection name="5.4 The Web Application Deployment Descriptor">
<p>
The final step in setting up the application is to configure the
@@ -545,11 +541,9 @@
we see that the following entries need to be created or modified.
</p>
-</section>
+</subsection>
-<section
- name="5.4.1 Configure the ActionServlet Instance"
- href="dd_config_servlet">
+<subsection name="5.4.1 Configure the ActionServlet Instance">
<p>
Add an entry defining the action servlet itself, along with the
@@ -557,7 +551,7 @@
Such an entry might look like this:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
@@ -571,7 +565,7 @@
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
-]]></code></pre>
+]]></source>
<p>
The initialization parameters supported by the action servlet are
@@ -652,11 +646,9 @@
wide singleton.
</p>
-</section>
+</subsection>
-<section
- name="5.4.2 Configure the ActionServlet Mapping"
- href="dd_config_mapping">
+<subsection name="5.4.2 Configure the ActionServlet Mapping">
<p>
<strong>Note:</strong> The material in this section is not specific to
@@ -680,19 +672,19 @@
Such an entry might look like this:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>
-]]></code></pre>
+]]></source>
<p>
which means that a request URI to match the <code>/logon</code> path
described earlier might look like this:
</p>
-<pre><code>http://www.mycompany.com/myapplication/do/logon</code></pre>
+<source>http://www.mycompany.com/myapplication/do/logon</source>
<p>
where <code>/myapplication</code> is the context path under which your
@@ -710,19 +702,19 @@
the mapping entry would look like this:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
-]]></code></pre>
+]]></source>
<p>
and a request URI to match the <code>/logon</code> path described
earlier might look like this:
</p>
-<pre><code>http://www.mycompany.com/myapplication/logon.do</code></pre>
+<source>http://www.mycompany.com/myapplication/logon.do</source>
<p>
<strong>WARNING</strong> - Struts will not
@@ -737,11 +729,9 @@
that <strong>only</strong> extension mapping is supported.
</p>
-</section>
+</subsection>
-<section
- name="5.4.3 Configure the Struts Tag Libraries"
- href="dd_config_taglib">
+<subsection name="5.4.3 Configure the Struts Tag Libraries">
<p>
Next, you must add an entry defining the Struts tag libraries.
@@ -786,7 +776,7 @@
uses:
</p>
-<pre><code><![CDATA[
+<source><![CDATA[
<taglib>
<taglib-uri>
http://struts.apache.org/tags-bean
@@ -827,7 +817,7 @@
/WEB-INF/struts-nested.tld
</taglib-location>
</taglib>
-]]></code></pre>
+]]></source>
<p>
This tells the JSP system where to find the tag library descriptor
@@ -835,11 +825,9 @@
out on the Internet somewhere).
</p>
-</section>
+</subsection>
-<section
- name="5.4.3.1 Configure the Struts Tag Libraries (Servlet 2.3/2.4)"
- href="dd_config_taglib_23">
+<subsection name="5.4.3.1 Configure the Struts Tag Libraries (Servlet
2.3/2.4)">
<p>
<strong>Servlet 2.3/2.4 users only:</strong> The Servlet 2.3 and 2.4
specifications simplify
@@ -856,25 +844,24 @@
your code like this:
</p>
- <pre><code>
+ <source>
<%@ taglib
uri="http://struts.apache.org/tags-html"
prefix="html" %>
- </code></pre>
+ </source>
<p>
Note that you <strong>must use the full uri</strong> defined in the various
- tlds (see the <a href="#dd_config_taglib">example configuration</a> for
reference)
+ tlds (see the <a href="5_4_3_Configure_the_Struts_Tag_Libraries">
+ example configuration</a> for reference)
so that the container knows where to find the tag's class files.
You don't have to alter your <code>web.xml</code> file or copy tlds into
any
application directories.
</p>
-</section>
+</subsection>
-<section
- name="5.5 Add Struts Components To Your Application"
- href="config_add">
+<subsection name="5.5 Add Struts Components To Your Application">
<p>
To use Struts, you must copy the .tld files that you require into
@@ -885,7 +872,7 @@
<p>
<strong>Servlet 2.3/2.4 Users:</strong> See
- <a href="#dd_config_taglib_23">section 4.5.3.1</a>
+ <a href="5_4_3_Configure_the_Struts_Tag_Libraries_23">section 4.5.3.1</a>
for how to avoid copying the tlds into your application.
</p>
@@ -972,11 +959,9 @@
</p>
</div>
-</section>
+</subsection>
-<section
- name="5.6 Logging in Struts Based Applications"
- href="config_logging">
+<subsection name="5.6 Logging in Struts Based Applications">
<p>
Since Struts 1.0, the logging functionality was fairly limited. You could
@@ -1056,16 +1041,17 @@
You can seamlessly integrate logging from your own components into the same
logging implementation that Struts and the Commons libraries use, by
following the instructions in
- <a href="building_controller.html#logging">Section 4.10</a>. If you do
+ <a href="building_controller.html#4_11_Commons_Logging_Interface">
+ Section 4.11</a>. If you do
this, you are strongly encouraged to follow the same naming convention for
loggers (based on the class name of the messages being logged) for
maximum configuration flexibility.
</p>
-</section>
+</subsection>
-<section>
+<subsection>
<p>
For more about putting it all together, see the <a
href="../faqs/apps.html">
@@ -1076,8 +1062,8 @@
Next: <a href="./release-notes.html">Release Notes</a>
</p>
-</section>
+</subsection>
- </chapter>
+ </section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]