You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2017/04/02 09:12:56 UTC

svn commit: r1009571 [1/3] - /websites/production/struts/content/getting-started/

Author: lukaszlenart
Date: Sun Apr  2 09:12:56 2017
New Revision: 1009571

Log:
Updates production

Modified:
    websites/production/struts/content/getting-started/coding-actions.html
    websites/production/struts/content/getting-started/control-tags.html
    websites/production/struts/content/getting-started/debugging-struts.html
    websites/production/struts/content/getting-started/exception-handling.html
    websites/production/struts/content/getting-started/form-tags.html
    websites/production/struts/content/getting-started/form-validation-using-xml.html
    websites/production/struts/content/getting-started/form-validation.html
    websites/production/struts/content/getting-started/message-resource-files.html
    websites/production/struts/content/getting-started/processing-forms.html
    websites/production/struts/content/getting-started/spring.html
    websites/production/struts/content/getting-started/themes.html
    websites/production/struts/content/getting-started/wildcard-method-selection.html

Modified: websites/production/struts/content/getting-started/coding-actions.html
==============================================================================
--- websites/production/struts/content/getting-started/coding-actions.html (original)
+++ websites/production/struts/content/getting-started/coding-actions.html Sun Apr  2 09:12:56 2017
@@ -143,11 +143,9 @@
 
 <p><strong>Action Mapping</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;action name="hello" class="org.apache.struts.helloworld.action.HelloWorldAction" method="execute"&gt;
-	&lt;result name="success"&gt;/HelloWorld.jsp&lt;/result&gt;
-&lt;/action&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;action</span> <span class="na">name=</span><span class="s">"hello"</span> <span class="na">class=</span><span class="s">"org.apache.struts.helloworld.action.HelloWorldAction"</span> <span class="na">method=</span><span class="s">"execute"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;result</span> <span class="na">name=</span><span class="s">"success"</span><span class="nt">&gt;</span>/HelloWorld.jsp<span class="nt">&lt;/result&gt;</span>
+<span class="nt">&lt;/action&gt;</span>
 </code></pre>
 </div>
 
@@ -159,105 +157,59 @@
 
 <p>Action classes act as the controller in the MVC pattern. Action classes respond to a user action, execute business logic (or call upon other classes to do that), and then return a result that tells Struts what view to render.</p>
 
-<p>Struts 2 Action classes usually extend the</p>
+<p>Struts 2 Action classes usually extend the <code class="highlighter-rouge">ActionSupport</code> class, which is provided by the Struts 2 framework. Class <code class="highlighter-rouge">ActionSupport</code> provides default implementations for the most common actions (e.g. execute, input) and also implements several useful Struts 2 interfaces. When your Action class extends class <code class="highlighter-rouge">ActionSupport</code> your class can either override the default implementations or inherit them.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>ActionSupport
-</code></pre>
-</div>
-<p>class, which is provided by the Struts 2 framework. Class</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>ActionSupport
-</code></pre>
-</div>
-<p>provides default implementations for the most common actions (e.g. execute, input) and also implements several useful Struts 2 interfaces. When your Action class extends class</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>ActionSupport
-</code></pre>
-</div>
-<p>your class can either override the default implementations or inherit them.</p>
-
-<p>If you examine class HelloWorldAction from tutorial <a href="#PAGE_14811875">Using Struts 2 Tags</a> you’ll see that it extends class</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>ActionSupport
-</code></pre>
-</div>
-<p>and then overrides method execute.</p>
+<p>If you examine class HelloWorldAction from tutorial <a href="using-tags.html">Using Struts 2 Tags</a> you’ll see that it extends class <code class="highlighter-rouge">ActionSupport</code> and then overrides method execute.</p>
 
 <p>In method execute is where we placed what we want this controller to do in response to the hello.action.</p>
 
 <p><strong>Method execute of HelloWorldAction</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>public String execute() throws Exception {
-		
-	messageStore = new MessageStore() ;
-		
-	helloCount++;
-		
-	return SUCCESS;
-
-}
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="kd">public</span> <span class="n">String</span> <span class="nf">execute</span><span class="p">(</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">messageStore</span> <span class="o">=</span> <span class="k">new</span> <span class="n">MessageStore</span><span class="o">()</span> <span class="o">;</span>
 
+    <span class="n">helloCount</span><span class="o">++;</span>
 
+    <span class="k">return</span> <span class="n">SUCCESS</span><span class="o">;</span>
+<span class="o">}</span>
 </code></pre>
 </div>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
-
 <blockquote>
   <p>Note that method execute declares it throws an Exception. We’ll cover in a later tutorial how to configure Struts to handle any Exceptions thrown from the Action classes methods.</p>
 </blockquote>
 
-<blockquote>
-
-</blockquote>
-
 <p><strong>Processing Form Input In The Action Class</strong></p>
 
-<p>One of the most common responsibilities of the Action class is to process user input on a form and then make the result of the processing available to the view page. To illustrate this responsibility, let’s say that on our view page, HelloWorld.jsp, we want
- to display a personal hello, such as “Hello Struts User Bruce.”</p>
+<p>One of the most common responsibilities of the Action class is to process user input on a form and then make the result of the processing available to the view page. To illustrate this responsibility, let’s say that on our view page, HelloWorld.jsp, we want to display a personal hello, such as “Hello Struts User Bruce.”</p>
 
-<p>In the <a href="#PAGE_14811875">Using Struts 2 Tags</a> example application we added a Struts 2 form to index.jsp.</p>
+<p>In the <a href="using-tags.html">Using Struts 2 Tags</a> example application we added a Struts 2 form to index.jsp.</p>
 
 <p><strong>Struts 2 Form Tags</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:form action="hello"&gt;
-
-	&lt;s:textfield name="userName" label="Your name" /&gt;
-	
-	&lt;s:submit value="Submit" /&gt;
-
-&lt;/s:form&gt;
-
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:form</span> <span class="na">action=</span><span class="s">"hello"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;s:textfield</span> <span class="na">name=</span><span class="s">"userName"</span> <span class="na">label=</span><span class="s">"Your name"</span> <span class="nt">/&gt;</span>
+    <span class="nt">&lt;s:submit</span> <span class="na">value=</span><span class="s">"Submit"</span> <span class="nt">/&gt;</span>
+<span class="nt">&lt;/s:form&gt;</span>
 </code></pre>
 </div>
 
 <p>Make a note of the value of the name attribute for the Struts 2 textfield tag, which is userName. When the user clicks on the submit button for the above form, the action hello will be executed (hello.action). The form field values will be posted to the Struts 2 Action class (HelloWorldAction). The Action class may automatically receive those form field values provided it has a public set method that matches the form field name value.</p>
 
-<p>So for the HelloWorldAction class to automatically receive the userName value it must have a public method setUserName (note the JavaBean convention discussed in tutorial <a href="#PAGE_14811871">Hello World</a>).</p>
+<p>So for the HelloWorldAction class to automatically receive the userName value it must have a public method setUserName (note the JavaBean convention discussed in tutorial <a href="hello-world-using-struts2.html">Hello World</a>).</p>
 
 <p>For the example application associated with this tutorial add the following Java code to class HelloWorldAction.</p>
 
 <p><strong>Add userName to HelloWorldAction</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>	private String userName;
-
-	public String getUserName() {
-		return userName;
-	}
-
-	public void setUserName(String userName) {
-		this.userName = userName;
-	}
-
+<div class="highlighter-rouge"><pre class="highlight"><code>    <span class="kd">private</span> <span class="n">String</span> <span class="n">userName</span><span class="o">;</span>
 
+    <span class="kd">public</span> <span class="n">String</span> <span class="n">getUserName</span><span class="o">()</span> <span class="o">{</span>
+        <span class="k">return</span> <span class="n">userName</span><span class="o">;</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="n">setUserName</span><span class="o">(</span><span class="n">String</span> <span class="n">userName</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">this</span><span class="o">.</span><span class="na">userName</span> <span class="o">=</span> <span class="n">userName</span><span class="o">;</span>
+    <span class="o">}</span>
 </code></pre>
 </div>
 
@@ -265,13 +217,9 @@
 
 <p><strong>Add userName value to message</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>if (userName != null) {
-			
-	messageStore.setMessage( messageStore.getMessage() + " " + userName);
-			
-}
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code>    <span class="k">if</span> <span class="o">(</span><span class="n">userName</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">messageStore</span><span class="o">.</span><span class="na">setMessage</span><span class="o">(</span> <span class="n">messageStore</span><span class="o">.</span><span class="na">getMessage</span><span class="o">()</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">userName</span><span class="o">);</span>
+    <span class="o">}</span>
 </code></pre>
 </div>
 
@@ -281,31 +229,17 @@
 
 <p>When the form is submitted, Struts will call any set methods of the HelloWorldAction class that match the form field names. So in this example method setUserName was called and passed the value the user entered in the userName form field.</p>
 
-<p>On the index.jsp we also have a Struts 2 action link (see tutorial <a href="#PAGE_14811875">Using Struts 2 Tags</a>) that includes a query string parameter: userName=Bruce+Phillips. If you click on that link you should see the result of:</p>
+<p>On the index.jsp we also have a Struts 2 action link (see tutorial <a href="using-tags.html">Using Struts 2 Tags</a>) that includes a query string parameter: userName=Bruce+Phillips. If you click on that link you should see the result of:</p>
 
 <p><img src="attachments/att14974997_hellobruce.png" alt="hellobruce.png" /></p>
 
 <p>Since the query string parameter is userName, Struts passed the value of that parameter to the setUserName method.</p>
 
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-  <p>On the view page, HelloWorld.jsp, you can also access the userName value by using the Struts 2 property tag (see tutorial <a href="#PAGE_14811875">Using Struts 2 Tags</a>). Try showing just the userName value on the view page.</p>
-</blockquote>
-
-<blockquote>
-
-</blockquote>
+<p>On the view page, HelloWorld.jsp, you can also access the userName value by using the Struts 2 property tag (see tutorial <a href="using-tags.html">Using Struts 2 Tags</a>). Try showing just the userName value on the view page.</p>
 
 <p><strong>Summary</strong></p>
 
-<p>This tutorial introduced you to how to code the Action class so it can process user input on a form or values in a query string parameter. If the form had numerous fields, it would be cumbersome to have a set method that matches up with each form field. So in our next tutorial will cover how to integrate a model class, form fields in the view, and form processing in the Action class.</p>
+<p>This tutorial introduced you to how to code the Action class so it can process user input on a form or values in a query string parameter. If the form had numerous fields, it would be cumbersome to have a set method that matches up with each form field. So our next tutorial will cover how to integrate a model class, form fields in the view and form processing in the Action class.</p>
 
 
   </section>

Modified: websites/production/struts/content/getting-started/control-tags.html
==============================================================================
--- websites/production/struts/content/getting-started/control-tags.html (original)
+++ websites/production/struts/content/getting-started/control-tags.html Sun Apr  2 09:12:56 2017
@@ -125,42 +125,24 @@
 
 <p>The example code for this tutorial, control_tags, is available at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a></p>
 
-<blockquote>
+<p><strong>Introduction</strong></p>
 
-</blockquote>
+<p>Struts 2 has several control tags that can be used in the view. This tutorial will discuss and show examples of how to use the Struts 2 if and iterator tags. For more information about these and other control tags visit <a href="http://cwiki.apache.org/confluence/display/WW/Generic+Tag+Reference">tags reference</a>.</p>
 
-<p>#####Introduction#####</p>
+<p>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a> is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</p>
 
-<p>Struts 2 has several control tags that can be used in the view. This tutorial will discuss and show examples of how to use the Struts 2 if and iterator tags. For more information about these and other control tags visit <a href="http://cwiki.apache.org/confluence/display/WW/Generic\+Tag\+Reference">tags reference</a>^[http://cwiki.apache.org/confluence/display/WW/Generic+Tag+Reference].</p>
-
-<table>
-  <tbody>
-    <tr>
-      <td>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a>^[http://struts.apache.org/mail.html] is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
-
-<p>#####Struts 2 if Tag#####</p>
+<p><strong>Struts 2 if Tag</strong></p>
 
 <p>In the example application’s thankyou.jsp is this markup.</p>
 
 <p><strong>thankyou.jsp Struts if Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:if test="personBean.over21"&gt;
-    &lt;p&gt;You are old enough to vote!&lt;/p&gt;
-&lt;/s:if&gt;
-&lt;s:else&gt;
-   &lt;p&gt;You are NOT old enough to vote.&lt;/p&gt;
-&lt;/s:else&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:if</span> <span class="na">test=</span><span class="s">"personBean.over21"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;p&gt;</span>You are old enough to vote!<span class="nt">&lt;/p&gt;</span>
+<span class="nt">&lt;/s:if&gt;</span>
+<span class="nt">&lt;s:else&gt;</span>
+   <span class="nt">&lt;p&gt;</span>You are NOT old enough to vote.<span class="nt">&lt;/p&gt;</span>
+<span class="nt">&lt;/s:else&gt;</span>
 </code></pre>
 </div>
 
@@ -170,28 +152,26 @@
 
 <p>The value of the test attribute must be an expression that evaluates to true or false, but doesn’t need to be a method call that returns a boolean. For example this s:if tag that is in thankyou.jsp has a more complicated expression.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:if test="personBean.carModels.length &gt; 1"&gt;
-	&lt;p&gt;Car models
-&lt;/s:if&gt;
-&lt;s:else&gt;
-   &lt;p&gt;Car model
-&lt;/s:else&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:if</span> <span class="na">test=</span><span class="s">"personBean.carModels.length &gt; 1"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;p&gt;</span>Car models
+<span class="nt">&lt;/s:if&gt;</span>
+<span class="nt">&lt;s:else&gt;</span>
+   <span class="nt">&lt;p&gt;</span>Car model
+<span class="nt">&lt;/s:else&gt;</span>
 </code></pre>
 </div>
 
 <p>The purpose of the above markup is to use either “Car model” or “Car models” depending on how many car models the user selected on the edit page. So the value for the test attribute of this iterator tag gets the length of the carModels String array and compares that to 1. If it’s greater then 1, the correct grammar is “Car models” else the correct grammar is “Car model”.</p>
 
-<p>#####Struts iterator Tag#####</p>
+<p><strong>Struts iterator Tag</strong></p>
 
 <p>The Struts iterator tag is used to generate a loop that iterates over each item in a collection. In the thankyou.jsp is this markup.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;table style="margin-left:15px"&gt;
-	&lt;s:iterator value="personBean.carModels"&gt;
-		&lt;tr&gt;&lt;td&gt;&lt;s:property /&gt;&lt;/td&gt;&lt;/tr&gt;
-	&lt;/s:iterator&gt;
-&lt;/table&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;table</span> <span class="na">style=</span><span class="s">"margin-left:15px"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;s:iterator</span> <span class="na">value=</span><span class="s">"personBean.carModels"</span><span class="nt">&gt;</span>
+        <span class="nt">&lt;tr&gt;&lt;td&gt;&lt;s:property</span> <span class="nt">/&gt;&lt;/td&gt;&lt;/tr&gt;</span>
+    <span class="nt">&lt;/s:iterator&gt;</span>
+<span class="nt">&lt;/table&gt;</span>
 </code></pre>
 </div>
 
@@ -199,24 +179,23 @@
 
 <p>The iterator tag has a value attribute that must evaluate to a collection (Array, List, Map).</p>
 
-<p>The s:property tag nested inside the iterator tag is used to display the specific value of the collection each time the iterator loops over an element of the collection. Since the collection is an Array of String objects, the s:property tag doesn’t need to specify a value attribute. By default the s:property tag will display the single String for that element of the collection.</p>
+<p>The <code class="highlighter-rouge">s:property</code> tag nested inside the iterator tag is used to display the specific value of the collection each time the iterator loops over an element of the collection. Since the collection is an Array of String objects, the <code class="highlighter-rouge">s:property</code> tag doesn’t need to specify a value attribute. By default the <code class="highlighter-rouge">s:property</code> tag will display the single String for that element of the collection.</p>
 
 <p>If the collection contains objects that have multiple fields, then you should use the value attribute of the s:property tag to determine what field to display. For example:</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;table style="margin-left:15px"&gt;
-	&lt;s:iterator value="states" &gt;	
-		&lt;tr&gt;&lt;td&gt;&lt;s:property value="stateAbbr" /&gt;&lt;/td&gt; &lt;td&gt;&lt;s:property value="stateName" /&gt;&lt;/tr&gt;
-	&lt;/s:iterator&gt;
-&lt;/table&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;table</span> <span class="na">style=</span><span class="s">"margin-left:15px"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;s:iterator</span> <span class="na">value=</span><span class="s">"states"</span> <span class="nt">&gt;</span>	
+        <span class="nt">&lt;tr&gt;&lt;td&gt;&lt;s:property</span> <span class="na">value=</span><span class="s">"stateAbbr"</span> <span class="nt">/&gt;&lt;/td&gt;</span> <span class="nt">&lt;td&gt;&lt;s:property</span> <span class="na">value=</span><span class="s">"stateName"</span> <span class="nt">/&gt;&lt;/tr&gt;</span>
+    <span class="nt">&lt;/s:iterator&gt;</span>
+<span class="nt">&lt;/table&gt;</span>
 </code></pre>
 </div>
 
-<p>The value of the iterator tag is states, which causes the Struts 2 framework to call the getStates method of the Action class (EditAction.java). The getStates method returns a List of State objects. The State class has two fields stateAbbr and stateName, both having the appropriate get method. The iterator will loop over each State object stored in the collection. Each time through the loop, the Struts 2 framework will have a reference to the current State object and will call getStateAbbr and getStateName methods for that current State object.</p>
+<p>The value of the iterator tag is states, which causes the Struts 2 framework to call the getStates method of the Action class (<code class="highlighter-rouge">EditAction.java</code>). The getStates method returns a List of State objects. The State class has two fields stateAbbr and stateName, both having the appropriate get method. The iterator will loop over each State object stored in the collection. Each time through the loop, the Struts 2 framework will have a reference to the current State object and will call getStateAbbr and getStateName methods for that current State object.</p>
 
-<p>#####Additional Iterator Attributes#####</p>
+<p><strong>Additional Iterator Attributes</strong></p>
 
-<p>The Struts 2 iterator tag has additional attributes you can use to control the begin and end values for specifying that the iterator tag should only loop over a part of the collection. See the <a href="https://cwiki.apache.org/confluence/display/WW/iterator">iterator tag reference</a>^[https://cwiki.apache.org/confluence/display/WW/iterator] for more information.</p>
+<p>The Struts 2 iterator tag has additional attributes you can use to control the begin and end values for specifying that the iterator tag should only loop over a part of the collection. See the <a href="https://cwiki.apache.org/confluence/display/WW/iterator">iterator tag reference</a> for more information.</p>
 
   </section>
 </article>

Modified: websites/production/struts/content/getting-started/debugging-struts.html
==============================================================================
--- websites/production/struts/content/getting-started/debugging-struts.html (original)
+++ websites/production/struts/content/getting-started/debugging-struts.html Sun Apr  2 09:12:56 2017
@@ -129,20 +129,7 @@
 
 <p>During development of a Struts 2 web application you may want to view the information being managed by the Struts 2 framework. This tutorial will cover two tools you can use to see how Struts 2 views your web application. One tool is the Struts 2 configuration plugin and the other is the debugging interceptor. This article also discusses how to set the log level to see more or fewer log messages.</p>
 
-<table>
-  <tbody>
-    <tr>
-      <td>The Struts 2 <a href="http://struts.apache.org/mail.html">user mailing list</a>^[http://struts.apache.org/mail.html] is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
+<p>The Struts 2 <a href="http://struts.apache.org/mail.html">user mailing list</a> is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</p>
 
 <p><strong>Configuration Plugin</strong></p>
 
@@ -150,8 +137,7 @@
 
 <p>To use the plugin in your application, just call index.action in namespace config-browser. For example you could have the following link on your admin page (or just anywhere during your development).</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;a href="&lt;s:url action="index" namespace="config-browser" /&gt;"&gt;Launch the configuration browser&lt;/a&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">"&lt;s:url action="</span><span class="na">index</span><span class="err">"</span> <span class="na">namespace=</span><span class="s">"config-browser"</span> <span class="nt">/&gt;</span>"&gt;Launch the configuration browser<span class="nt">&lt;/a&gt;</span>
 </code></pre>
 </div>
 
@@ -171,14 +157,9 @@
 
 <p><strong>Using the Debugging Interceptor</strong></p>
 
-<p>If you have set</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>devMode
-</code></pre>
-</div>
-<p>to true (in the example application see struts.xml) then one of the interceptors that is activated when Struts 2 processes an action is the DebuggingInterceptor. The DebuggingInterceptor looks for a query string appended to the action URL with a name of debug and a value of xml, console, command, or browser.</p>
+<p>If you have set <code class="highlighter-rouge">devMode</code> to true (in the example application see <code class="highlighter-rouge">struts.xml</code>) then one of the interceptors that is activated when Struts 2 processes an action is the DebuggingInterceptor. The DebuggingInterceptor looks for a query string appended to the action URL with a name of debug and a value of xml, console, command, or browser.</p>
 
-<p>If the DebuggingInterceptor finds that query string then it will halt further execution of the action and instead return to the browser debugging information. The format of the returned information depends on the value of the debug query parameter. See <em>DebuggingInterceptor</em>  for more detail.</p>
+<p>If the DebuggingInterceptor finds that query string then it will halt further execution of the action and instead return to the browser debugging information. The format of the returned information depends on the value of the debug query parameter. See <a href="//struts.apache.org/docs/debugginginterceptor.html">DebuggingInterceptor</a>  for more detail.</p>
 
 <p>In the example application on the index.jsp is a link for displaying debugging information. This link includes the query string debug=browser. If you click on this link you’ll see a table with columns that can be expanded and collapsed. The table contains the various objects and their state being managed by the Struts 2 framework.</p>
 
@@ -188,7 +169,7 @@
 
 <p><strong>Struts 2 Logging</strong></p>
 
-<p>The Struts 2 framework will write to a log a great deal of information if you’ve configured the log properties to log at the debug level. In the example application, view log4j.xml. The two major packages involved in the Struts 2 framework, com.opensymphony and org.apache.struts2, are configured to write debug and above log messages. When you run the application view the standard out for your Servlet container to see all the information written to the log. Please check <em>Logging</em>  page for other options.</p>
+<p>The Struts 2 framework will write to a log a great deal of information if you’ve configured the log properties to log at the debug level. In the example application, view <code class="highlighter-rouge">log4j.xml</code>. The two major packages involved in the Struts 2 framework, <code class="highlighter-rouge">com.opensymphony</code> and <code class="highlighter-rouge">org.apache.struts2</code>, are configured to write debug and above log messages. When you run the application view the standard out for your Servlet container to see all the information written to the log. Please check <a href="//struts.apache.org/docs/logging.html">Logging</a>  page for other options.</p>
 
 <p><strong>Summary</strong></p>
 

Modified: websites/production/struts/content/getting-started/exception-handling.html
==============================================================================
--- websites/production/struts/content/getting-started/exception-handling.html (original)
+++ websites/production/struts/content/getting-started/exception-handling.html Sun Apr  2 09:12:56 2017
@@ -125,47 +125,27 @@
 
 <p>The code for this tutorial, exception_handling, is available for checkout at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>.</p>
 
-<blockquote>
-
-</blockquote>
-
-<p>#####Introduction#####</p>
+<p><strong>Introduction</strong></p>
 
 <p>In this tutorial we’ll explore how to enable the Struts 2 framework to handle any uncaught exceptions generated by a web application. Struts 2 provides robust exception handling, including the ability to automatically log any uncaught exceptions and redirect the user to a error web page.</p>
 
-<table>
-  <tbody>
-    <tr>
-      <td>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a>^[http://struts.apache.org/mail.html] is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
+<p>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a> is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</p>
 
-<p>#####Global Exception Handling#####</p>
+<p><strong>Global Exception Handling</strong></p>
 
 <p>Using the Struts 2 framework you can specify in the struts.xml how the framework should handle uncaught exceptions. The handling logic can apply to all actions (global exception handling) or to a specific action. Let’s first discuss how to enable global exception handling.</p>
 
-<p>To enable global exception handling you need to add two nodes to struts.xml: global-exception-mapping and global-results. For example examine struts.xml from the exception_handling project.</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>  
-   &lt;global-results&gt;
-        &lt;result name="securityerror"&gt;/securityerror.jsp&lt;/result&gt;
-  	&lt;result name="error"&gt;/error.jsp&lt;/result&gt;
-   &lt;/global-results&gt;
-
-   &lt;global-exception-mappings&gt;
-	&lt;exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" result="securityerror" /&gt;
-	 &lt;exception-mapping exception="java.lang.Exception" result="error" /&gt;
-   &lt;/global-exception-mappings&gt;
-  
+<p>To enable global exception handling you need to add two nodes to <code class="highlighter-rouge">struts.xml</code>: <code class="highlighter-rouge">global-exception-mapping</code> and <code class="highlighter-rouge">global-results</code>. For example examine the <code class="highlighter-rouge">struts.xml</code> from the exception_handling project.</p>
 
+<div class="highlighter-rouge"><pre class="highlight"><code>    <span class="nt">&lt;global-results&gt;</span>
+        <span class="nt">&lt;result</span> <span class="na">name=</span><span class="s">"securityerror"</span><span class="nt">&gt;</span>/securityerror.jsp<span class="nt">&lt;/result&gt;</span>
+  	<span class="nt">&lt;result</span> <span class="na">name=</span><span class="s">"error"</span><span class="nt">&gt;</span>/error.jsp<span class="nt">&lt;/result&gt;</span>
+    <span class="nt">&lt;/global-results&gt;</span>
+
+    <span class="nt">&lt;global-exception-mappings&gt;</span>
+	<span class="nt">&lt;exception-mapping</span> <span class="na">exception=</span><span class="s">"org.apache.struts.register.exceptions.SecurityBreachException"</span> <span class="na">result=</span><span class="s">"securityerror"</span> <span class="nt">/&gt;</span>
+	 <span class="nt">&lt;exception-mapping</span> <span class="na">exception=</span><span class="s">"java.lang.Exception"</span> <span class="na">result=</span><span class="s">"error"</span> <span class="nt">/&gt;</span>
+    <span class="nt">&lt;/global-exception-mappings&gt;</span>
 </code></pre>
 </div>
 
@@ -173,73 +153,66 @@
 
 <p>The global results mapping node relates the result value to a specific view page. For example the result “securityerror” will cause the framework to redirect the user’s browser to the securityerror.jsp view page.</p>
 
-<p>#####Exception Handling Per Action#####</p>
+<p><strong>Exception Handling Per Action</strong></p>
 
 <p>If you need to handle an exception in a specific way for a certain action you can use the exception-mapping node within the action node.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>   &lt;action name="actionspecificexception" class="org.apache.struts.register.action.Register" method="throwSecurityException"&gt;
-     &lt;exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" 
-          result="login" /&gt;
-      &lt;result&gt;/register.jsp&lt;/result&gt;
-      &lt;result name="login"&gt;/login.jsp&lt;/result&gt;
-   &lt;/action&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code>   <span class="nt">&lt;action</span> <span class="na">name=</span><span class="s">"actionspecificexception"</span> <span class="na">class=</span><span class="s">"org.apache.struts.register.action.Register"</span> <span class="na">method=</span><span class="s">"throwSecurityException"</span><span class="nt">&gt;</span>
+      <span class="nt">&lt;exception-mapping</span> <span class="na">exception=</span><span class="s">"org.apache.struts.register.exceptions.SecurityBreachException"</span> <span class="na">result=</span><span class="s">"login"</span> <span class="nt">/&gt;</span>
+      <span class="nt">&lt;result&gt;</span>/register.jsp<span class="nt">&lt;/result&gt;</span>
+      <span class="nt">&lt;result</span> <span class="na">name=</span><span class="s">"login"</span><span class="nt">&gt;</span>/login.jsp<span class="nt">&lt;/result&gt;</span>
+   <span class="nt">&lt;/action&gt;</span>
 </code></pre>
 </div>
 
-<p>The above action node from the example application’s struts.xml file specifies that if method throwSecurityException throws an uncaught exception of type SecurityBreachException the Struts 2 framework should return a result of login. The login result will cause the user’s browser to be redirected to login.jsp.</p>
+<p>The above action node from the example application’s struts.xml file specifies that if the method <code class="highlighter-rouge">throwSecurityException</code> throws an uncaught exception of type <code class="highlighter-rouge">SecurityBreachException</code> the Struts 2 framework should return a result of login. The login result will cause the user’s browser to be redirected to login.jsp.</p>
 
 <p>You can see that an action-specific exception mapping will take precedence if the same exception is also mapped globally.</p>
 
-<p>#####Logging Exceptions#####</p>
+<p><strong>Logging Exceptions</strong></p>
 
-<p>You can configure the Struts 2 framework to log any uncaught exceptions. To enable logging of the exceptions being handled by the Struts 2 framework you must specify some parameter values in struts.xml. If you examine the <a href="http://struts.apache.org/release/2.3.x/xwork-core/apidocs/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptor.html">ExceptionMappingInterceptor class API</a>^[http://struts.apache.org/release/2.3.x/xwork-core/apidocs/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptor.html] there are three parameter values you can set to enable logging (logEnabled), the log level to use (logLevel), and the log category (logCategory) to specify in the log message.</p>
+<p>You can configure the Struts 2 framework to log any uncaught exceptions. To enable logging of the exceptions being handled by the Struts 2 framework you must specify some parameter values in struts.xml. If you examine the <a href="https://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptor.html">ExceptionMappingInterceptor class API</a> there are three parameter values you can set to enable logging (logEnabled), the log level to use (logLevel), and the log category (logCategory) to specify in the log message.</p>
 
 <p>To set these parameter values for all actions that use a specific stack of interceptors in a package include the following in struts.xml just after the opening package node.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;interceptors&gt;
-  &lt;interceptor-stack name="appDefaultStack"&gt;
-    &lt;interceptor-ref name="defaultStack"&gt;
-     &lt;param name="exception.logEnabled"&gt;true&lt;/param&gt;
-     &lt;param name="exception.logLevel"&gt;ERROR&lt;/param&gt;
-    &lt;/interceptor-ref&gt;
- &lt;/interceptor-stack&gt;
-&lt;/interceptors&gt;
-
-&lt;default-interceptor-ref name="appDefaultStack" /&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;interceptors&gt;</span>
+    <span class="nt">&lt;interceptor-stack</span> <span class="na">name=</span><span class="s">"appDefaultStack"</span><span class="nt">&gt;</span>
+        <span class="nt">&lt;interceptor-ref</span> <span class="na">name=</span><span class="s">"defaultStack"</span><span class="nt">&gt;</span>
+            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"exception.logEnabled"</span><span class="nt">&gt;</span>true<span class="nt">&lt;/param&gt;</span>
+            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"exception.logLevel"</span><span class="nt">&gt;</span>ERROR<span class="nt">&lt;/param&gt;</span>
+        <span class="nt">&lt;/interceptor-ref&gt;</span>
+    <span class="nt">&lt;/interceptor-stack&gt;</span>
+<span class="nt">&lt;/interceptors&gt;</span>
 
+<span class="nt">&lt;default-interceptor-ref</span> <span class="na">name=</span><span class="s">"appDefaultStack"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
-<p>The above interceptors node configures a new stack of Struts 2 interceptors named appDefaultStack. This stack of interceptors is based upon the defaultStack of interceptors (which are the Struts 2 interceptors that execute by default whenever an Action class method is called by the Struts 2 framework).</p>
+<p>The above interceptors node configures a new stack of Struts 2 interceptors named <code class="highlighter-rouge">appDefaultStack</code>. This stack of interceptors is based upon the defaultStack of interceptors (which are the Struts 2 interceptors that execute by default whenever an Action class method is called by the Struts 2 framework).</p>
 
 <p>The ExceptionMappingInterceptor is one of the Struts 2 interceptors that is part of the default stack. In the definition of the struts defaultStack, the ExceptionMappingInterceptor is given the name of exception. By specifying a param node with the name of exception.logEnabled and a value of true, I’m setting the logEnabled parameter of the ExceptionMappingInterceptor class to true.</p>
 
 <p>Now when the application throws an uncaught exception, the Struts 2 framework will handle it and will also write an entry to the log that includes the stack trace. In the example above, I’ve set the level to log these exceptions to be ERROR.</p>
 
-<p>In the example applications, the logging is just to the Servlet container’s console (see the log4j.xml file for the log settings).</p>
+<p>In the example applications, the logging is just to the Servlet container’s console (see the <code class="highlighter-rouge">log4j.xml</code> file for the log settings).</p>
 
-<p>#####Display Exception Information In Browser#####</p>
+<p><strong>Display Exception Information In Browser</strong></p>
 
 <p>You can display information about the exception in the browser if you want by using s:property tags with a value of exception and exceptionStack. For example in error.jsp is this markup.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>   &lt;h4&gt;The application has malfunctioned.&lt;/h4&gt;
-
-   &lt;p&gt;  Please contact technical support with the following information:&lt;/p&gt; 
-
-   &lt;h4&gt;Exception Name: &lt;s:property value="exception" /&gt; &lt;/h4&gt;
+<div class="highlighter-rouge"><pre class="highlight"><code>   <span class="nt">&lt;h4&gt;</span>The application has malfunctioned.<span class="nt">&lt;/h4&gt;</span>
 
-   &lt;h4&gt;Exception Details: &lt;s:property value="exceptionStack" /&gt;&lt;/h4&gt; 
+   <span class="nt">&lt;p&gt;</span>  Please contact technical support with the following information:<span class="nt">&lt;/p&gt;</span> 
 
+   <span class="nt">&lt;h4&gt;</span>Exception Name: <span class="nt">&lt;s:property</span> <span class="na">value=</span><span class="s">"exception"</span> <span class="nt">/&gt;</span> <span class="nt">&lt;/h4&gt;</span>
 
+   <span class="nt">&lt;h4&gt;</span>Exception Details: <span class="nt">&lt;s:property</span> <span class="na">value=</span><span class="s">"exceptionStack"</span> <span class="nt">/&gt;&lt;/h4&gt;</span> 
 </code></pre>
 </div>
 
 <p>When the exception interceptor is triggered it adds to the fields available for display the exception message and the exception’s stack trace.</p>
 
-<p>#####Summary#####</p>
+<p><strong>Summary</strong></p>
 
 <p>Struts 2 provides a easy to use configuration for handling uncaught exceptions and redirecting users to appropriate view pages. You can configure exception handling to be global for all actions or to just for a specific action. You can also enable the Struts 2 framework to log the uncaught exceptions.</p>
 

Modified: websites/production/struts/content/getting-started/form-tags.html
==============================================================================
--- websites/production/struts/content/getting-started/form-tags.html (original)
+++ websites/production/struts/content/getting-started/form-tags.html Sun Apr  2 09:12:56 2017
@@ -125,30 +125,13 @@
 
 <p>The example code for this tutorial, form_tags, can be checked out from <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>.</p>
 
-<blockquote>
-
-</blockquote>
+<p><strong>Introduction</strong></p>
 
-<p>#####Introduction#####</p>
+<p>In this tutorial we’ll explore some of the other Struts 2 form controls. In our previous tutorials that explained how to use Struts 2 forms (<a href="processing-forms.html">Processing Forms</a> , <a href="form-validation.html">Form Validation</a> , and <a href="message-resource-files.html">Message Resource Files</a> ) we covered how to use the Struts 2 head, form, textfield controls and the key attribute. This tutorial will explore using the Struts 2 select, radio, checkbox, and checkboxlist form controls.</p>
 
-<p>In this tutorial we’ll explore some of the other Struts 2 form controls. In our previous tutorials that explained how to use Struts 2 forms (<em>Processing Forms</em> , <em>Form Validation</em> , and <em>Message Resource Files</em> ) we covered how to use the Struts 2 head, form, textfield controls and the key attribute. This tutorial will explore using the Struts 2 select, radio, checkbox, and checkboxlist form controls.</p>
+<p>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a> is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</p>
 
-<table>
-  <tbody>
-    <tr>
-      <td>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a>^[http://struts.apache.org/mail.html] is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
-
-<p>#####Example Application#####</p>
+<p><strong>Example Application</strong></p>
 
 <p>The example application that supports this tutorial shows how to use Struts 2 form tags so that a user can edit his information. The information that can be edited is encapsulated in an object of class Person. A Person object knows these things: first name, last name, favorite sport, gender, state of residency, is or is not over 21, and car models owned.</p>
 
@@ -160,36 +143,22 @@
 
 <p>The first and last names are shown on the form (see edit.jsp) using the Struts 2 textfield tag, which we’ve discussed in previous tutorials.</p>
 
-<p>#####Struts 2 Select Tag#####</p>
+<p><strong>Struts 2 Select Tag</strong></p>
 
 <p>A user can select one favorite sport from several choices. The example application uses the Struts 2 select tag to provide the list of options for the select box.</p>
 
 <p><strong>Struts 2 Select Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:select key="personBean.sport" list="sports" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:select</span> <span class="na">key=</span><span class="s">"personBean.sport"</span> <span class="na">list=</span><span class="s">"sports"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
-<p>In these form tags, we are using the key attribute as discussed in the <em>Message Resource Files</em>  tutorial. The key attribute is used by the Struts 2 framework to determine values for the other attributes (e.g. label and value). We are also using a property file associated with the EditAction class to provide the label values based on the key attribute value (see the <em>Message Resource Files</em>  tutorial for information on using Struts 2 property files).</p>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
+<p>In these form tags, we are using the key attribute as discussed in the <a href="message-resource-files.html">Message Resource Files</a> tutorial. The key attribute is used by the Struts 2 framework to determine values for the other attributes (e.g. label and value). We are also using a property file associated with the EditAction class to provide the label values based on the key attribute value (see the <a href="message-resource-files.html">Message Resource Files</a> tutorial for information on using Struts 2 property files).</p>
 
 <blockquote>
   <p>Note that there are many attributes for the Struts 2 form tags, most of which mirror the HTML attributes associated with the tags. You can read about all the attributes for a Struts 2 form tag by consulting the Struts 2 documentation.</p>
 </blockquote>
 
-<blockquote>
-
-</blockquote>
-
 <p>The value of the list attribute of the Struts 2 select tag is used by the framework to determine what method of the action class to call in order to create the option values. In our example application, the list attribute value of “sports” results in the framework calling the getSports method of class EditAction. That method returns a String array containing “football”, “baseball”, and “basketball”. Those values are used to create the option tags inside the select tag.</p>
 
 <p>The Struts 2 framework determines which option is preselected by using the key attribute’s value to call a method on the personBean object. Since the key attribute’s value is “personBean.sport”, the framework calls the personBean object’s getSport method. If the value returned by that method matches one of the option values, that option will be marked as “selected”.</p>
@@ -198,20 +167,18 @@
 
 <p><strong>HTML Created By Struts 2 Select Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;tr&gt;
-&lt;td class="tdLabel"&gt;
-&lt;label for="save_personBean_sport" class="label"&gt;Favorite sport:&lt;/label&gt;
-&lt;/td&gt;
-&lt;td&gt;
-&lt;select name="personBean.sport" id="save_personBean_sport"&gt;
-    &lt;option value="football"&gt;football&lt;/option&gt;
-    &lt;option value="baseball"&gt;baseball&lt;/option&gt;
-    &lt;option value="basketball" selected="selected"&gt;basketball&lt;/option&gt;
-&lt;/select&gt;
-&lt;/td&gt;
-&lt;/tr&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;tr&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">class=</span><span class="s">"tdLabel"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_sport"</span> <span class="na">class=</span><span class="s">"label"</span><span class="nt">&gt;</span>Favorite sport:<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;td&gt;</span>
+<span class="nt">&lt;select</span> <span class="na">name=</span><span class="s">"personBean.sport"</span> <span class="na">id=</span><span class="s">"save_personBean_sport"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"football"</span><span class="nt">&gt;</span>football<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"baseball"</span><span class="nt">&gt;</span>baseball<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"basketball"</span> <span class="na">selected=</span><span class="s">"selected"</span><span class="nt">&gt;</span>basketball<span class="nt">&lt;/option&gt;</span>
+<span class="nt">&lt;/select&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;/tr&gt;</span>
 </code></pre>
 </div>
 
@@ -219,15 +186,13 @@
 
 <p>Since the personBean’s getSport method returns “baskeball”, the basketball option value is marked as selected.</p>
 
-<p>#####Struts 2 Radio Tag#####</p>
+<p><strong>Struts 2 Radio Tag</strong></p>
 
 <p>The Struts 2 radio tag—like its standard HTML counterpart—is used to display 2 or more choices, only one of which can be selected by the user. Here is the code for the Struts 2 radio button from the example application.</p>
 
 <p><strong>Struts 2 Radio Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:radio key="personBean.gender" list="genders" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:radio</span> <span class="na">key=</span><span class="s">"personBean.gender"</span> <span class="na">list=</span><span class="s">"genders"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
@@ -235,31 +200,27 @@
 
 <p><strong>HTML Created By Struts 2 Radio Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;tr&gt;
-&lt;td class="tdLabel"&gt;
-&lt;label for="save_personBean_gender" class="label"&gt;Gender:&lt;/label&gt;&lt;/td&gt;
-&lt;td&gt;
-&lt;input type="radio" name="personBean.gender" id="save_personBean_gendermale" value="male"/&gt;&lt;label for="save_personBean_gendermale"&gt;male&lt;/label&gt;
-&lt;input type="radio" name="personBean.gender" id="save_personBean_genderfemale" value="female"/&gt;&lt;label for="save_personBean_genderfemale"&gt;female&lt;/label&gt;
-&lt;input type="radio" name="personBean.gender" id="save_personBean_gendernot sure" checked="checked" value="not sure"/&gt;&lt;label for="save_personBean_gendernot sure"&gt;not sure&lt;/label&gt;
-&lt;/td&gt;
-&lt;/tr&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;tr&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">class=</span><span class="s">"tdLabel"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_gender"</span> <span class="na">class=</span><span class="s">"label"</span><span class="nt">&gt;</span>Gender:<span class="nt">&lt;/label&gt;&lt;/td&gt;</span>
+<span class="nt">&lt;td&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"radio"</span> <span class="na">name=</span><span class="s">"personBean.gender"</span> <span class="na">id=</span><span class="s">"save_personBean_gendermale"</span> <span class="na">value=</span><span class="s">"male"</span><span class="nt">/&gt;&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_gendermale"</span><span class="nt">&gt;</span>male<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"radio"</span> <span class="na">name=</span><span class="s">"personBean.gender"</span> <span class="na">id=</span><span class="s">"save_personBean_genderfemale"</span> <span class="na">value=</span><span class="s">"female"</span><span class="nt">/&gt;&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_genderfemale"</span><span class="nt">&gt;</span>female<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"radio"</span> <span class="na">name=</span><span class="s">"personBean.gender"</span> <span class="na">id=</span><span class="s">"save_personBean_gendernot sure"</span> <span class="na">checked=</span><span class="s">"checked"</span> <span class="na">value=</span><span class="s">"not sure"</span><span class="nt">/&gt;&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_gendernot sure"</span><span class="nt">&gt;</span>not sure<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;/tr&gt;</span>
 </code></pre>
 </div>
 
 <p>Also just like the Struts 2 select tag the result returned by calling the personBean object’s getGender method is used to determine which of the radio buttons is checked.</p>
 
-<p>#####Struts 2 Select Tag - Object Backed#####</p>
+<p><strong>Struts 2 Select Tag - Object Backed</strong></p>
 
 <p>You may need to create a Struts 2 select tag where the options displayed to the user each have their own value that is different then what is displayed. In the example application, the user’s residency is stored as a two-letter abbreviation (e.g. KS), but the form select box should display the full state name (e.g. Kansas). To create such a select box in Struts 2, you would use this code</p>
 
 <p><strong>Struts 2 Select Tag Object Backed</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:select key="personBean.residency" list="states" listKey="stateAbbr" listValue="stateName" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:select</span> <span class="na">key=</span><span class="s">"personBean.residency"</span> <span class="na">list=</span><span class="s">"states"</span> <span class="na">listKey=</span><span class="s">"stateAbbr"</span> <span class="na">listValue=</span><span class="s">"stateName"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
@@ -269,35 +230,31 @@
 
 <p><strong>HTML Created By Struts 2 Select Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;tr&gt;
-&lt;td class="tdLabel"&gt;
-&lt;label for="save_personBean_residency" class="label"&gt;State resident:&lt;/label&gt;&lt;/td&gt;
-&lt;td&gt;
-&lt;select name="personBean.residency" id="save_personBean_residency"&gt;
-    &lt;option value="AZ"&gt;Arizona&lt;/option&gt;
-    &lt;option value="CA"&gt;California&lt;/option&gt;
-    &lt;option value="FL"&gt;Florida&lt;/option&gt;
-    &lt;option value="KS" selected="selected"&gt;Kansas&lt;/option&gt;
-    &lt;option value="NY"&gt;New York&lt;/option&gt;
-&lt;/select&gt;
-&lt;/td&gt;
-&lt;/tr&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;tr&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">class=</span><span class="s">"tdLabel"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_residency"</span> <span class="na">class=</span><span class="s">"label"</span><span class="nt">&gt;</span>State resident:<span class="nt">&lt;/label&gt;&lt;/td&gt;</span>
+<span class="nt">&lt;td&gt;</span>
+<span class="nt">&lt;select</span> <span class="na">name=</span><span class="s">"personBean.residency"</span> <span class="na">id=</span><span class="s">"save_personBean_residency"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"AZ"</span><span class="nt">&gt;</span>Arizona<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"CA"</span><span class="nt">&gt;</span>California<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"FL"</span><span class="nt">&gt;</span>Florida<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"KS"</span> <span class="na">selected=</span><span class="s">"selected"</span><span class="nt">&gt;</span>Kansas<span class="nt">&lt;/option&gt;</span>
+    <span class="nt">&lt;option</span> <span class="na">value=</span><span class="s">"NY"</span><span class="nt">&gt;</span>New York<span class="nt">&lt;/option&gt;</span>
+<span class="nt">&lt;/select&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;/tr&gt;</span>
 </code></pre>
 </div>
 
 <p>The value returned by calling the personBean object’s getResidency method determines which of the select tag’s option tags is marked as selected. In our example, since getResidency returns “KS”, the option tag whose value attribute equals “KS” is marked as selected.</p>
 
-<p>#####Struts 2 Checkbox Tag#####</p>
+<p><strong>Struts 2 Checkbox Tag</strong></p>
 
 <p>The Struts 2 checkbox tag is used to create the HTML input type equals checkbox tag. The value for the key attribute tells the framework what method to call to determine if the checkbox is checked or not checked. The method called should return a Boolean value (true or false). A return value of true will cause the checkbox to be checked and false the checkbox will not be checked.</p>
 
 <p><strong>Struts 2 Checkbox Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:checkbox key="personBean.over21" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:checkbox</span> <span class="na">key=</span><span class="s">"personBean.over21"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
@@ -305,16 +262,14 @@
 
 <p><strong>HTML Created By Struts 2 Checkbox Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;tr&gt;
-&lt;td valign="top" align="right"&gt;
-&lt;/td&gt;
-&lt;td valign="top" align="left"&gt;
-&lt;input type="checkbox" name="personBean.over21" value="true" checked="checked" id="save_personBean_over21"/&gt;
-&lt;input type="hidden" id="__checkbox_save_personBean_over21" name="__checkbox_personBean.over21" value="true" /&gt;  &lt;label for="save_personBean_over21" class="checkboxLabel"&gt;21 or older&lt;/label&gt;
-&lt;/td&gt;
-&lt;/tr&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;tr&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">valign=</span><span class="s">"top"</span> <span class="na">align=</span><span class="s">"right"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">valign=</span><span class="s">"top"</span> <span class="na">align=</span><span class="s">"left"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"checkbox"</span> <span class="na">name=</span><span class="s">"personBean.over21"</span> <span class="na">value=</span><span class="s">"true"</span> <span class="na">checked=</span><span class="s">"checked"</span> <span class="na">id=</span><span class="s">"save_personBean_over21"</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"hidden"</span> <span class="na">id=</span><span class="s">"__checkbox_save_personBean_over21"</span> <span class="na">name=</span><span class="s">"__checkbox_personBean.over21"</span> <span class="na">value=</span><span class="s">"true"</span> <span class="nt">/&gt;</span>  <span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_over21"</span> <span class="na">class=</span><span class="s">"checkboxLabel"</span><span class="nt">&gt;</span>21 or older<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;/tr&gt;</span>
 </code></pre>
 </div>
 
@@ -322,7 +277,7 @@
 
 <p>If you examine the HTML code created by the Struts 2 checkbox tag, you’ll see that it created a hidden field associated with the personBean.over21 checkbox. When the Struts 2 framework intercepts the submission of this form it will use this hidden form field to check if the associated checkbox field exists in the posted form data. If that checkbox field doesn’t exist then the Struts 2 framework will know to update the value of the personBean object’s over21 instance variable to false.</p>
 
-<p>#####Struts 2 checkboxlist Tag#####</p>
+<p><strong>Struts 2 checkboxlist Tag</strong></p>
 
 <p>The Struts 2 framework provides a unique form field control that creates a series of associated check boxes, one or more of which can be checked. In the example application, the Person class has an Array of Strings, which is used to store car models owned by a person.</p>
 
@@ -330,9 +285,7 @@
 
 <p><strong>Struts 2 Checkboxlist Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:checkboxlist key="personBean.carModels" list="carModelsAvailable" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:checkboxlist</span> <span class="na">key=</span><span class="s">"personBean.carModels"</span> <span class="na">list=</span><span class="s">"carModelsAvailable"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
@@ -342,23 +295,21 @@
 
 <p><strong>HTML Created By Struts 2 Checkboxlist Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;tr&gt;
-&lt;td class="tdLabel"&gt;
-&lt;label for="save_personBean_carModels" class="label"&gt;Car models owned:&lt;/label&gt;&lt;/td&gt;
-&lt;td&gt;
-&lt;input type="checkbox" name="personBean.carModels" value="Ford" id="personBean.carModels-1" checked="checked"/&gt;
-&lt;label for="personBean.carModels-1" class="checkboxLabel"&gt;Ford&lt;/label&gt;
-&lt;input type="checkbox" name="personBean.carModels" value="Chrysler" id="personBean.carModels-2"/&gt;
-&lt;label for="personBean.carModels-2" class="checkboxLabel"&gt;Chrysler&lt;/label&gt;
-&lt;input type="checkbox" name="personBean.carModels" value="Toyota" id="personBean.carModels-3"/&gt;
-&lt;label for="personBean.carModels-3" class="checkboxLabel"&gt;Toyota&lt;/label&gt;
-&lt;input type="checkbox" name="personBean.carModels" value="Nissan" id="personBean.carModels-4" checked="checked"/&gt;
-&lt;label for="personBean.carModels-4" class="checkboxLabel"&gt;Nissan&lt;/label&gt;
-&lt;input type="hidden" id="__multiselect_save_personBean_carModels" name="__multiselect_personBean.carModels" value="" /&gt;
-&lt;/td&gt;
-&lt;/tr&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;tr&gt;</span>
+<span class="nt">&lt;td</span> <span class="na">class=</span><span class="s">"tdLabel"</span><span class="nt">&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"save_personBean_carModels"</span> <span class="na">class=</span><span class="s">"label"</span><span class="nt">&gt;</span>Car models owned:<span class="nt">&lt;/label&gt;&lt;/td&gt;</span>
+<span class="nt">&lt;td&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"checkbox"</span> <span class="na">name=</span><span class="s">"personBean.carModels"</span> <span class="na">value=</span><span class="s">"Ford"</span> <span class="na">id=</span><span class="s">"personBean.carModels-1"</span> <span class="na">checked=</span><span class="s">"checked"</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"personBean.carModels-1"</span> <span class="na">class=</span><span class="s">"checkboxLabel"</span><span class="nt">&gt;</span>Ford<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"checkbox"</span> <span class="na">name=</span><span class="s">"personBean.carModels"</span> <span class="na">value=</span><span class="s">"Chrysler"</span> <span class="na">id=</span><span class="s">"personBean.carModels-2"</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"personBean.carModels-2"</span> <span class="na">class=</span><span class="s">"checkboxLabel"</span><span class="nt">&gt;</span>Chrysler<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"checkbox"</span> <span class="na">name=</span><span class="s">"personBean.carModels"</span> <span class="na">value=</span><span class="s">"Toyota"</span> <span class="na">id=</span><span class="s">"personBean.carModels-3"</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"personBean.carModels-3"</span> <span class="na">class=</span><span class="s">"checkboxLabel"</span><span class="nt">&gt;</span>Toyota<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"checkbox"</span> <span class="na">name=</span><span class="s">"personBean.carModels"</span> <span class="na">value=</span><span class="s">"Nissan"</span> <span class="na">id=</span><span class="s">"personBean.carModels-4"</span> <span class="na">checked=</span><span class="s">"checked"</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"personBean.carModels-4"</span> <span class="na">class=</span><span class="s">"checkboxLabel"</span><span class="nt">&gt;</span>Nissan<span class="nt">&lt;/label&gt;</span>
+<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"hidden"</span> <span class="na">id=</span><span class="s">"__multiselect_save_personBean_carModels"</span> <span class="na">name=</span><span class="s">"__multiselect_personBean.carModels"</span> <span class="na">value=</span><span class="s">""</span> <span class="nt">/&gt;</span>
+<span class="nt">&lt;/td&gt;</span>
+<span class="nt">&lt;/tr&gt;</span>
 </code></pre>
 </div>
 

Modified: websites/production/struts/content/getting-started/form-validation-using-xml.html
==============================================================================
--- websites/production/struts/content/getting-started/form-validation-using-xml.html (original)
+++ websites/production/struts/content/getting-started/form-validation-using-xml.html Sun Apr  2 09:12:56 2017
@@ -125,30 +125,13 @@
 
 <p>The example code for this tutorial, form_xml_validation, is available for checkout at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a></p>
 
-<blockquote>
+<p><strong>Introduction</strong></p>
 
-</blockquote>
+<p>In this tutorial we’ll cover how to validate a user’s input in form fields using Struts 2’s XML validation methodology. In the <a href="form-validation.html">Form Validation</a> tutorial we discussed validating a user’s input using the validate method in the Action class. Using a separate XML validation file gives you the ability to use validators built-in to the Struts 2 framework.</p>
 
-<p>#####Introduction#####</p>
+<p>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a> is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</p>
 
-<p>In this tutorial we’ll cover how to validate a user’s input in form fields using Struts 2’s XML validation methodology. In the <em>Form Validation</em>  tutorial we discussed validating a user’s input using the validate method in the Action class. Using a separate XML validation file gives you the ability to use validators built-in to the Struts 2 framework.</p>
-
-<table>
-  <tbody>
-    <tr>
-      <td>The <a href="http://struts.apache.org/mail.html">Struts 2 user mailing list</a>^[http://struts.apache.org/mail.html] is an excellent place to get help. If you are having a problem getting the tutorial example applications to work search the Struts 2 mailing list. If you don’t find an answer to your problem, post a question on the mailing list.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
-
-<p>#####Example Application#####</p>
+<p><strong>Example Application</strong></p>
 
 <p>The example application that supports this tutorial shows how to use Struts 2’s XML validation methodology. The information that can be edited is encapsulated in an object of class Person.</p>
 
@@ -158,47 +141,37 @@
 
 <p>When the user submits the form, we want to validate his entries into the form fields.</p>
 
-<p>#####Validation Using XML#####</p>
+<p><strong>Validation Using XML</strong></p>
 
 <p>To validate a user’s form field entries you can use a separate XML file that contains your validation rules. The XML file that contains the validation rules must be named as ActionClassName-validation.xml. In the example application, the XML validation file is named EditAction-validation.xml (see src/main/resources/org/apache/struts/edit/action).</p>
 
-<p>Struts 2 provides several different validators that you can use in the XML validation file. See <em>Validation</em>  for a list of validators you can employ.</p>
+<p>Struts 2 provides several different validators that you can use in the XML validation file. See <a href="//struts.apache.org/docs/validation.html">Validation</a> for a list of validators you can employ.</p>
 
-<p>In the above form, we want to ensure the user enters a first name. To have the Struts 2 framework enforce that rule we can used the Struts 2 <em>requiredstring validator</em> . This validator checks that the user has entered a string value in the form field.</p>
+<p>In the above form, we want to ensure the user enters a first name. To have the Struts 2 framework enforce that rule we can used the Struts 2 <a href="//struts.apache.org/docs/requiredstring-validator.html">requiredstring validator</a>. This validator checks that the user has entered a string value in the form field.</p>
 
-<p>#####XML Validator Format#####</p>
+<p><strong>XML Validator Format</strong></p>
 
 <p>In the XML validation file (for this example that is EditAction-validation.xml), is this XML:</p>
 
 <p><strong>XML Validator Required String</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="cp">&lt;!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"&gt;</span>
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="cp">&lt;!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"&gt;</span>
 
 <span class="nt">&lt;validators&gt;</span>
- <span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"requiredstring"</span><span class="nt">&gt;</span>
- 	<span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.firstName<span class="nt">&lt;/param&gt;</span>
- 	<span class="nt">&lt;message&gt;</span>First name is required.<span class="nt">&lt;/message&gt;</span>
- <span class="nt">&lt;/validator&gt;</span>
+    <span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"requiredstring"</span><span class="nt">&gt;</span>
+        <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.firstName<span class="nt">&lt;/param&gt;</span>
+        <span class="nt">&lt;message&gt;</span>First name is required.<span class="nt">&lt;/message&gt;</span>
+    <span class="nt">&lt;/validator&gt;</span>
 <span class="nt">&lt;/validators&gt;</span>
-
-
 </code></pre>
 </div>
 
-<p>Within the validators node you can have 1 or more validator nodes. The type attribute specifies which validator you want the Struts 2 framework to use (see <em>Validation</em> ). The param name=”fieldname” node is used to tell the framework which form field entry to apply the rule to. See edit.jsp for the form fields and their name value (review <a href="#PAGE_19300595">Struts 2 Form Tags</a> if you’re not familiar with how to use Struts 2 form tags). The message node is used to tell the framework what message to display if the validation fails.</p>
-
-<table>
-  <tbody>
-    <tr>
-      <td>There are alternate ways to write the XML that goes in the validation XML file. See <em>Validation</em>  in the Struts 2 documentation for a full discussion.</td>
-    </tr>
-  </tbody>
-</table>
+<p>Within the validators node you can have 1 or more validator nodes. The type attribute specifies which validator you want the Struts 2 framework to use (see <a href="//struts.apache.org/docs/validation.html">Validation</a> ). The param name=”fieldname” node is used to tell the framework which form field entry to apply the rule to. See edit.jsp for the form fields and their name value (review <a href="form-tags.html">Struts 2 Form Tags</a> if you’re not familiar with how to use Struts 2 form tags). The message node is used to tell the framework what message to display if the validation fails.</p>
 
 <table>
   <tbody>
     <tr>
+      <td>There are alternate ways to write the XML that goes in the validation XML file. See <a href="//struts.apache.org/docs/validation.html">Validation</a> in the Struts 2 documentation for a full discussion.</td>
     </tr>
   </tbody>
 </table>
@@ -207,66 +180,60 @@
 
 <p><img src="attachments/att20873264_form-validation-2.png" alt="form-validation-2.png" /></p>
 
-<p>#####Validating An Email Address#####</p>
+<p><strong>Validating An Email Address</strong></p>
 
-<p>You can use the Struts 2 <em>email validator</em>  to validate the user’s input in the email field. Here is the validator node that is in the EditAction-validation.xml file.</p>
+<p>You can use the Struts 2 <a href="//struts.apache.org/docs/email-validator.html">email validator</a> to validate the user’s input in the email field. Here is the validator node that is in the <code class="highlighter-rouge">EditAction-validation.xml</code> file.</p>
 
 <p><strong>Email Validator</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code> &lt;validator type="requiredstring"&gt;
- 	&lt;param name="fieldname"&gt;personBean.email&lt;/param&gt;
- 	&lt;message&gt;Email address is required.&lt;/message&gt;
- &lt;/validator&gt;
- &lt;validator type="email"&gt;
- 	&lt;param name="fieldname"&gt;personBean.email&lt;/param&gt;
- 	&lt;message&gt;Email address not valid.&lt;/message&gt;
- &lt;/validator&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"requiredstring"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.email<span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;message&gt;</span>Email address is required.<span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/validator&gt;</span>
+<span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"email"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.email<span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;message&gt;</span>Email address not valid.<span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/validator&gt;</span>
 </code></pre>
 </div>
 
 <p>Note that in the example, we are requiring the user to enter an email address and then validating the email address the user entered.</p>
 
-<p>#####Validating A User’s Input Using A Regular Expression#####</p>
+<p><strong>Validating A User’s Input Using A Regular Expression</strong></p>
 
-<p>The Struts 2 framework provides a powerful way to validate a user’s form field input by using the <em>regex validator</em> . In the example application, we want to ensure the user enters the phone number in the format 999-999-9999. We can use a regular expression and the <em>regex validator</em>  to enforce this rule.</p>
+<p>The Struts 2 framework provides a powerful way to validate a user’s form field input by using the <a href="//struts.apache.org/docs/regex-validator.html">regex validator</a> . In the example application, we want to ensure the user enters the phone number in the format 999-999-9999. We can use a regular expression and the <a href="//struts.apache.org/docs/regex-validator.html">regex validator</a> to enforce this rule.</p>
 
 <p><strong>REGEX Validator</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validator type="requiredstring"&gt;
- 	&lt;param name="fieldname"&gt;personBean.phoneNumber&lt;/param&gt;
- 	&lt;message&gt;Phone number is required.&lt;/message&gt;
- &lt;/validator&gt;
-&lt;validator type="regex"&gt;
-	&lt;param name="fieldname"&gt;personBean.phoneNumber&lt;/param&gt;
-	&lt;param name="regex"&gt;&lt;![CDATA[\d{3}-\d{3}-\d{4}]]&gt;&lt;/param&gt;
-	&lt;message&gt;Phone number must be entered as 999-999-9999.&lt;/message&gt;
-&lt;/validator&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"requiredstring"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.phoneNumber<span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;message&gt;</span>Phone number is required.<span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/validator&gt;</span>
+<span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"regex"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.phoneNumber<span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"regex"</span><span class="nt">&gt;</span><span class="cp">&lt;![CDATA[\d{3}-\d{3}-\d{4}]]&gt;</span><span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;message&gt;</span>Phone number must be entered as 999-999-9999.<span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/validator&gt;</span>
 </code></pre>
 </div>
 
 <p>The param name=”expression” node is used to specify the regular expression that will be applied to the user’s input. Note how the regular expression is contained within a CDATA section.</p>
 
-<p>#####Validating A User’s Input Using An OGNL Expression#####</p>
+<p><strong>Validating A User’s Input Using An OGNL Expression</strong></p>
 
-<p>In the example application, we want to ensure the user checks at least one of the car model check boxes. To enforce this rule we can use the <em>fieldexpression validator</em> . Here’s the XML for that validator node.</p>
+<p>In the example application, we want to ensure the user checks at least one of the car model check boxes. To enforce this rule we can use the <a href="//struts.apache.org/docs/fieldexpression-validator.html">fieldexpression validator</a> . Here’s the XML for that validator node.</p>
 
 <p><strong>FieldExpression Validator</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;validator type="fieldexpression"&gt;
-	&lt;param name="fieldname"&gt;personBean.carModels&lt;/param&gt;
-	&lt;param name="expression"&gt;&lt;![CDATA[personBean.carModels.length &gt; 0]]&gt;&lt;/param&gt;
-	&lt;message&gt;You must select at least one car model.&lt;/message&gt;
-&lt;/validator&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;validator</span> <span class="na">type=</span><span class="s">"fieldexpression"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"fieldname"</span><span class="nt">&gt;</span>personBean.carModels<span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"expression"</span><span class="nt">&gt;</span><span class="cp">&lt;![CDATA[personBean.carModels.length &gt; 0]]&gt;</span><span class="nt">&lt;/param&gt;</span>
+    <span class="nt">&lt;message&gt;</span>You must select at least one car model.<span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/validator&gt;</span>
 </code></pre>
 </div>
 
-<p>The param name=”expression” node contains an OGNL expression that evaluates to true or false. We haven’t previously discussed OGNL, which stands for Object-Graph Navigation Language (see <a href="http://www.opensymphony.com/ognl/">http://www.opensymphony.com/ognl/</a> and <em>OGNL</em> ). OGNL expressions can be evaluated by the Struts 2 framework as Java statements.</p>
+<p>The param name=”expression” node contains an OGNL expression that evaluates to true or false. We haven’t previously discussed OGNL, which stands for Object-Graph Navigation Language (see <a href="http://www.opensymphony.com/ognl/">http://www.opensymphony.com/ognl/</a> and <a href="//struts.apache.org/docs/ognl.html">OGNL</a> ). OGNL expressions can be evaluated by the Struts 2 framework as Java statements.</p>
 
 <p>In the above XML the value of the param name=”expression” node, personBean.carModels.length &gt; 0, will be evaluated by the framework as a Java statement. The part personBean.carModels tells the framework to call the getCarModels method of class Person. That method returns an Array. Since class Array has a length attribute, the framework will get the value of the length attribute of the Array returned by the getCarModels method.</p>
 
@@ -276,7 +243,7 @@
 
 <p>The fieldexpression validator is useful when doing conditional validation of a user’s input. If the OGNL expression doesn’t evaluate to true then the user’s input won’t be allowed.</p>
 
-<p>#####Summary#####</p>
+<p><strong>Summary</strong></p>
 
 <p>The Struts 2 framework provides easy-to-use validation methodologies. You can add a validate method to the Action class or have a separate XML file with validation rules or you can use a combination of both methodologies.</p>