struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1009512 - in /websites/production/struts/content/getting-started: hello-world-using-struts2.html using-tags.html
Date Sat, 01 Apr 2017 08:13:46 GMT
Author: lukaszlenart
Date: Sat Apr  1 08:13:46 2017
New Revision: 1009512

Log:
Updates production

Modified:
    websites/production/struts/content/getting-started/hello-world-using-struts2.html
    websites/production/struts/content/getting-started/using-tags.html

Modified: websites/production/struts/content/getting-started/hello-world-using-struts2.html
==============================================================================
--- websites/production/struts/content/getting-started/hello-world-using-struts2.html (original)
+++ websites/production/struts/content/getting-started/hello-world-using-struts2.html Sat Apr  1 08:13:46 2017
@@ -154,19 +154,7 @@
 <p>Let’s look at an example model class, Action, server page, and mapping. If you like, fire up your Java IDE, and enter the code as we go.</p>
 
 <blockquote>
-  <p>This tutorial assumes you’ve completed the <a href="#PAGE_14811860">How To Create A Struts 2 Web Application</a> tutorial and have a working basic Struts project. The example code for this tutorial, helloworld, is available for checkout from the</p>
-</blockquote>
-
-<blockquote>
-  <p>Struts 2 GitHub repository at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>. The example projects use Maven</p>
-</blockquote>
-
-<blockquote>
-  <p>to manage the artifact dependencies and to build the .war files.</p>
-</blockquote>
-
-<blockquote>
-
+  <p>This tutorial assumes you’ve completed the <a href="#PAGE_14811860">How To Create A Struts 2 Web Application</a> tutorial and have a working basic Struts project. The example code for this tutorial, helloworld, is available for checkout from the Struts 2 GitHub repository at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>. The example projects use Maven to manage the artifact dependencies and to build the .war files.</p>
 </blockquote>
 
 <p><strong>The Code</strong></p>
@@ -176,14 +164,7 @@
 <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 this application 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>
+      <td>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 this application 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>
@@ -193,50 +174,34 @@
 <p>If you’re using the Basic_Struts2_Ant project to start with create the MessageStore class in the src folder and if you’re using the Basic_Struts2_Mvn class create the MessageStore class in src/main/java. Be sure to note the package statement below.</p>
 
 <blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
   <p>Note that in the code shown below the JavaDoc comments are omitted. In the download example, JavaDoc comments are included.</p>
 </blockquote>
 
-<blockquote>
-
-</blockquote>
-
 <p><strong>MessageStore.java</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>package org.apache.struts.helloworld.model;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">struts</span><span class="o">.</span><span class="na">helloworld</span><span class="o">.</span><span class="na">model</span><span class="o">;</span>
 
-public class MessageStore {
-	
-	private String message;
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MessageStore</span> <span class="o">{</span>
 	
-	public MessageStore() {
-		
-		setMessage("Hello Struts User");
-	}
-
-	public String getMessage() {
-
-		return message;
-	}
+    <span class="kd">private</span> <span class="n">String</span> <span class="n">message</span><span class="o">;</span>
 
-	public void setMessage(String message) {
+    <span class="kd">public</span> <span class="n">MessageStore</span><span class="o">()</span> <span class="o">{</span>
+        <span class="n">setMessage</span><span class="o">(</span><span class="s">"Hello Struts User"</span><span class="o">);</span>
+    <span class="o">}</span>
 
-		this.message = message;
-	}
+    <span class="kd">public</span> <span class="n">String</span> <span class="n">getMessage</span><span class="o">()</span> <span class="o">{</span>
+        <span class="k">return</span> <span class="n">message</span><span class="o">;</span>
+    <span class="o">}</span>
 
-}
+    <span class="kd">public</span> <span class="kt">void</span> <span class="n">setMessage</span><span class="o">(</span><span class="n">String</span> <span class="n">message</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">this</span><span class="o">.</span><span class="na">message</span> <span class="o">=</span> <span class="n">message</span><span class="o">;</span>
+    <span class="o">}</span>
 
+<span class="o">}</span>
 </code></pre>
 </div>
 
-<p>In the model class above note the use of public set and get methods to allow access to the private message String attribute. The Struts 2 framework requires that objects you want to expose to the view (HelloWorld.jsp) follow the <a href="http://en.wikipedia.org/wiki/JavaBean\#JavaBean_conventions">JavaBean-style conventions</a>^[http://en.wikipedia.org/wiki/JavaBean#JavaBean_conventions].</p>
+<p>In the model class above note the use of public set and get methods to allow access to the private message String attribute. The Struts 2 framework requires that objects you want to expose to the view (HelloWorld.jsp) follow the <a href="http://en.wikipedia.org/wiki/JavaBean\#JavaBean_conventions">JavaBean-style conventions</a>.</p>
 
 <p><strong>Step 2 - Create The Action Class HelloWorldAction.java</strong></p>
 
@@ -246,90 +211,43 @@ public class MessageStore {
 
 <p><strong>HelloWorldAction.java</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>package org.apache.struts.helloworld.action;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">struts</span><span class="o">.</span><span class="na">helloworld</span><span class="o">.</span><span class="na">action</span><span class="o">;</span>
 
-import org.apache.struts.helloworld.model.MessageStore;
-import com.opensymphony.xwork2.ActionSupport;
+<span class="kn">import</span> <span class="nn">org.apache.struts.helloworld.model.MessageStore</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.opensymphony.xwork2.ActionSupport</span><span class="o">;</span>
 
-public class HelloWorldAction extends ActionSupport {
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">HelloWorldAction</span> <span class="kd">extends</span> <span class="n">ActionSupport</span> <span class="o">{</span>
 
-	private static final long serialVersionUID = 1L;
+    <span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="mi">1L</span><span class="o">;</span>
 
-	private MessageStore messageStore;
-	
-	public String execute() throws Exception {
-		
-		messageStore = new MessageStore() ;
-		return SUCCESS;
-	}
-
-	public MessageStore getMessageStore() {
-		return messageStore;
-	}
-
-	public void setMessageStore(MessageStore messageStore) {
-		this.messageStore = messageStore;
-	}
+    <span class="kd">private</span> <span class="n">MessageStore</span> <span class="n">messageStore</span><span class="o">;</span>
 
-}
+    <span class="kd">public</span> <span class="n">String</span> <span class="n">execute</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="k">return</span> <span class="n">SUCCESS</span><span class="o">;</span>
+    <span class="o">}</span>
 
-</code></pre>
-</div>
-
-<p>The Struts 2 framework will create an object of the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorldAction
-</code></pre>
-</div>
-<p> class and call the execute method in response to a user’s action (clicking on a hyperlink that sends a specific URL to the Servlet container).</p>
+    <span class="kd">public</span> <span class="n">MessageStore</span> <span class="n">getMessageStore</span><span class="o">()</span> <span class="o">{</span>
+        <span class="k">return</span> <span class="n">messageStore</span><span class="o">;</span>
+    <span class="o">}</span>
 
-<p>In this example, the execute method creates an object of class</p>
+    <span class="kd">public</span> <span class="kt">void</span> <span class="n">setMessageStore</span><span class="o">(</span><span class="n">MessageStore</span> <span class="n">messageStore</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">this</span><span class="o">.</span><span class="na">messageStore</span> <span class="o">=</span> <span class="n">messageStore</span><span class="o">;</span>
+    <span class="o">}</span>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
+<span class="o">}</span>
 </code></pre>
 </div>
-<p> and then returns the String constant</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>SUCCESS
-</code></pre>
-</div>
-<p>.</p>
-
-<p>Note also the public getter and setter methods for the private</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p> object. Since we want to make the</p>
+<p>The Struts 2 framework will create an object of the <code class="highlighter-rouge">HelloWorldAction</code> class and call the execute method in response to a user’s action (clicking on a hyperlink that sends a specific URL to the Servlet container).</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p> object available to the view page,</p>
+<p>In this example, the execute method creates an object of class <code class="highlighter-rouge">MessageStore</code> and then returns the String constant <code class="highlighter-rouge">SUCCESS</code>.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorld.jsp
-</code></pre>
-</div>
-<p> we need to follow the <a href="http://en.wikipedia.org/wiki/JavaBean\#JavaBean_conventions">JavaBean-style</a>^[http://en.wikipedia.org/wiki/JavaBean#JavaBean_conventions] of providing get and set methods.</p>
+<p>Note also the public getter and setter methods for the private <code class="highlighter-rouge">MessageStore</code> object. Since we want to make the <code class="highlighter-rouge">MessageStore</code> object available to the view page, <code class="highlighter-rouge">HelloWorld.jsp</code>, we need to follow the <a href="http://en.wikipedia.org/wiki/JavaBean\#JavaBean_conventions">JavaBean-style</a> of providing get and set methods.</p>
 
 <p><strong>Step 3 - Create The View HelloWorld.jsp</strong></p>
 
-<p>We need a server page to present the message that is stored in the model class</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p>. Create the below JSP in the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>WebContent
-</code></pre>
-</div>
-<p> folder (if using Ant) or in</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>src/main/webapp
-</code></pre>
-</div>
-<p>(if using Maven).</p>
+<p>We need a server page to present the message that is stored in the model class <code class="highlighter-rouge">MessageStore</code>. Create the below JSP in the <code class="highlighter-rouge">WebContent</code> folder (if using Ant) or in <code class="highlighter-rouge">src/main/webapp</code> (if using Maven).</p>
 
 <p><strong>HelloWorld.jsp</strong></p>
 
@@ -346,92 +264,20 @@ public class HelloWorldAction extends Ac
     <span class="nt">&lt;h2&gt;&lt;s:property</span> <span class="na">value=</span><span class="s">"messageStore.message"</span> <span class="nt">/&gt;&lt;/h2&gt;</span>
   <span class="nt">&lt;/body&gt;</span>
 <span class="nt">&lt;/html&gt;</span>
-
-</code></pre>
-</div>
-
-<p>The taglib directive tells the Servlet container that this page will be using the Struts 2 tags and that these tags will be preceded by an</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>s
 </code></pre>
 </div>
-<p>.</p>
 
-<p>The</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:property&gt;
-</code></pre>
-</div>
-<p> tag displays the value returned by calling the method</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessageStore
-</code></pre>
-</div>
-<p> of the</p>
+<p>The taglib directive tells the Servlet container that this page will be using the Struts 2 tags and that these tags will be preceded by an <code class="highlighter-rouge">s</code>.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorldAction
-</code></pre>
-</div>
-<p> controller class. That method returns a</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p> object. By adding the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>.message
-</code></pre>
-</div>
-<p> onto the messageStore part of the value attribute we are telling the Struts 2 framework to call the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessage
-</code></pre>
-</div>
-<p> method of that</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p> object. The</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessage
-</code></pre>
-</div>
-<p> method of class</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>MessageStore
-</code></pre>
-</div>
-<p> returns a String. It is that String that will be displayed by the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:property&gt;
-</code></pre>
-</div>
-<p> tag.</p>
+<p>The <code class="highlighter-rouge">&lt;s:property&gt;</code> tag displays the value returned by calling the method <code class="highlighter-rouge">getMessageStore</code> of the <code class="highlighter-rouge">HelloWorldAction</code> controller class. That method returns a <code class="highlighter-rouge">MessageStore</code> object. By adding the <code class="highlighter-rouge">.message</code> onto the messageStore part of the value attribute we are telling the Struts 2 framework to call the <code class="highlighter-rouge">getMessage</code> method of that <code class="highlighter-rouge">MessageStore</code> object. The <code class="highlighter-rouge">getMessage</code> method of class <code class="highlighter-rouge">MessageStore</code> returns a String. It is that String that will be displayed by the <code class="highlighter-rouge">&lt;s:property&gt;</code> tag.</p>
 
 <p>We’ll learn more about tags in the next tutorial. See the <em>Struts Tags</em>  for more information about tags.</p>
 
 <p><strong>Step 4 - Add The Struts Configuration In struts.xml</strong></p>
 
-<p>We need a mapping to tie the URL, the</p>
+<p>We need a mapping to tie the URL, the <code class="highlighter-rouge">HelloWorldAction</code> class (controller), and the <code class="highlighter-rouge">HelloWorld.jsp</code> (the view) together. The mapping tells the Struts 2 framework which class will respond to the user’s action (the URL), which method of that class will be executed, and what view to render based on the String result that method returns.</p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorldAction
-</code></pre>
-</div>
-<p> class (controller), and 
- the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorld.jsp
-</code></pre>
-</div>
-<p> (the view) together. The mapping tells the Struts 2 framework which class will respond to the user’s action (the URL), which method of that class will be executed, and what view to render based on the String result that method returns.</p>
-
-<p>Edit the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>struts.xml
-</code></pre>
-</div>
-<p>file (in the Mvn project that file is in the src/main/resources folder) to add the action mapping. Place the action node (action name=”hello”) between the opening and closing package node, just after the action mapping with the name=”index”. Your complete struts.xml should look like:</p>
+<p>Edit the <code class="highlighter-rouge">struts.xml</code> file (in the Mvn project that file is in the src/main/resources folder) to add the action mapping. Place the action node (action name=”hello”) between the opening and closing package node, just after the action mapping with the name=”index”. Your complete struts.xml should look like:</p>
 
 <p><strong>struts.xml</strong></p>
 
@@ -454,7 +300,6 @@ public class HelloWorldAction extends Ac
     <span class="nt">&lt;/action&gt;</span>
   <span class="nt">&lt;/package&gt;</span>
 <span class="nt">&lt;/struts&gt;</span>
-
 </code></pre>
 </div>
 
@@ -462,36 +307,23 @@ public class HelloWorldAction extends Ac
 
 <p>In index.jsp (see WebContent folder for Ant project and src/main/webapp for Mvn project) let’s add an Action URL the user can click on to tell the Struts 2 framework to run the execute method of the HelloWorldAction class and render the HelloWorld.jsp view.</p>
 
-<p>First add the taglib directive at the top of the jsp</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;
-</code></pre>
-</div>
-<p>. Next add this p tag</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;p&gt;&lt;a href="&lt;s:url action='hello'/&gt;"&gt;Hello World&lt;/a&gt;&lt;/p&gt;
-</code></pre>
-</div>
-<p>after the h1 tag. Your new index.jsp should look like:</p>
+<p>First add the taglib directive at the top of the jsp <code class="highlighter-rouge">&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;</code>. Next add this p tag <code class="highlighter-rouge">&lt;p&gt;&lt;a href="&lt;s:url action='hello'/&gt;"&gt;Hello World&lt;/a&gt;&lt;/p&gt;</code> after the h1 tag. Your new index.jsp should look like:</p>
 
 <p><strong>index.jsp</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="err">&lt;</span>%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%&gt;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="err">&lt;</span>%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt;
 <span class="err">&lt;</span>%@ taglib prefix="s" uri="/struts-tags" %&gt;
 <span class="cp">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</span>
 <span class="nt">&lt;html&gt;</span>
-<span class="nt">&lt;head&gt;</span>
-<span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=ISO-8859-1"</span><span class="nt">&gt;</span>
-<span class="nt">&lt;title&gt;</span>Basic Struts 2 Application - Welcome<span class="nt">&lt;/title&gt;</span>
-<span class="nt">&lt;/head&gt;</span>
-<span class="nt">&lt;body&gt;</span>
-<span class="nt">&lt;h1&gt;</span>Welcome To Struts 2!<span class="nt">&lt;/h1&gt;</span>
-<span class="nt">&lt;p&gt;&lt;a</span> <span class="na">href=</span><span class="s">"&lt;s:url action='hello'/&gt;"</span><span class="nt">&gt;</span>Hello World<span class="nt">&lt;/a&gt;&lt;/p&gt;</span>
-<span class="nt">&lt;/body&gt;</span>
+  <span class="nt">&lt;head&gt;</span>
+    <span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=ISO-8859-1"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;title&gt;</span>Basic Struts 2 Application - Welcome<span class="nt">&lt;/title&gt;</span>
+  <span class="nt">&lt;/head&gt;</span>
+  <span class="nt">&lt;body&gt;</span>
+    <span class="nt">&lt;h1&gt;</span>Welcome To Struts 2!<span class="nt">&lt;/h1&gt;</span>
+    <span class="nt">&lt;p&gt;&lt;a</span> <span class="na">href=</span><span class="s">"&lt;s:url action='hello'/&gt;"</span><span class="nt">&gt;</span>Hello World<span class="nt">&lt;/a&gt;&lt;/p&gt;</span>
+  <span class="nt">&lt;/body&gt;</span>
 <span class="nt">&lt;/html&gt;</span>
-
-
 </code></pre>
 </div>
 
@@ -499,7 +331,7 @@ public class HelloWorldAction extends Ac
 
 <p><strong>Step 6 - Build the WAR File and Run The Application</strong></p>
 
-<p>Execute mvn clean package to create the war file.</p>
+<p>Execute <code class="highlighter-rouge">mvn clean package</code> to create the war file.</p>
 
 <p>Copy the war file to your Servlet container. After your Servlet container successfully deploys the war file go to this URL <a href="http://localhost:8080/helloworld/index.action">http://localhost:8080/helloworld/index.action</a> where you should see the following:</p>
 
@@ -511,130 +343,33 @@ public class HelloWorldAction extends Ac
 
 <p><strong>Getting Help</strong></p>
 
-<p>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 this application 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>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 this application 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>How the Code Works</strong></p>
 
 <p>Your browser sends to the web server a request for the URL <a href="http://localhost:8080/Hello_World_Struts2_Ant/hello.action">http://localhost:8080/Hello_World_Struts2_Ant/hello.action</a>.</p>
 
 <ol>
-  <li>The container receives from the web server a request for the resource</li>
-</ol>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>hello.action
-</code></pre>
-</div>
-<p>. According to the settings loaded from the <em>web.xml</em> , the container finds that all requests are being routed to</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
-</code></pre>
-</div>
-<p>, including the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>*.action
-</code></pre>
-</div>
-<p>requests. The StrutsPrepareAndExecuteFilter is the entry point into the framework.</p>
-
-<ol>
-  <li>The framework looks for an action mapping named “hello”, and it finds that this mapping corresponds to the class “HelloWorldAction”. The framework instantiates the Action and calls the Action’s</li>
-</ol>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>execute
-</code></pre>
-</div>
-<p>method.</p>
-
-<ol>
-  <li>The</li>
-</ol>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>execute
-</code></pre>
-</div>
-<p>method creates the MessageStore object and returns</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>SUCCESS
-</code></pre>
-</div>
-<p>. The framework checks the action mapping to see what page to load if</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>SUCCESS
-</code></pre>
-</div>
-<p>is returned. The framework tells the container to render as the response to the request, the resource</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorld.jsp
-</code></pre>
-</div>
-<p>.</p>
-
-<ol>
-  <li>As the page</li>
-</ol>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorld.jsp
-</code></pre>
-</div>
-<p>is being processed, the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:property value="messageStore.message" /&gt;
-</code></pre>
-</div>
-<p>tag calls the getter</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessageStore
-</code></pre>
-</div>
-<p>of the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>HelloWorld
-</code></pre>
-</div>
-<p>Action and then calls the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessage
-</code></pre>
-</div>
-<p>of the MessageStore object returned by</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>getMessageStore
-</code></pre>
-</div>
-<p>, and the tag merges into the response the value of the message attribute.</p>
-
-<ol>
-  <li>A pure HTML response is sent back to the browser.</li>
+  <li>
+    <p>The container receives from the web server a request for the resource <code class="highlighter-rouge">hello.action</code>. According to the settings loaded from the <em>web.xml</em> , the container finds that all requests are being routed to <code class="highlighter-rouge">org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</code>, including the <code class="highlighter-rouge">*.action</code> requests. The StrutsPrepareAndExecuteFilter is the entry point into the framework.</p>
+  </li>
+  <li>
+    <p>The framework looks for an action mapping named “hello”, and it finds that this mapping corresponds to the class “HelloWorldAction”. The framework instantiates the Action and calls the Action’s <code class="highlighter-rouge">execute</code> method.</p>
+  </li>
+  <li>
+    <p>The <code class="highlighter-rouge">execute</code> method creates the MessageStore object and returns <code class="highlighter-rouge">SUCCESS</code>. The framework checks the action mapping to see what page to load if <code class="highlighter-rouge">SUCCESS</code> is returned. The framework tells the container to render as the response to the request, the resource <code class="highlighter-rouge">HelloWorld.jsp</code>.</p>
+  </li>
+  <li>
+    <p>As the page <code class="highlighter-rouge">HelloWorld.jsp</code> is being processed, the <code class="highlighter-rouge">&lt;s:property value="messageStore.message" /&gt;</code> tag calls the getter <code class="highlighter-rouge">getMessageStore</code> of the <code class="highlighter-rouge">HelloWorld</code> Action and then calls the <code class="highlighter-rouge">getMessage</code> of the MessageStore object returned by <code class="highlighter-rouge">getMessageStore</code>, and the tag merges into the response the value of the message attribute.</p>
+  </li>
+  <li>
+    <p>A pure HTML response is sent back to the browser.</p>
+  </li>
 </ol>
 
 <p><strong>What to Remember</strong></p>
 
-<p>The framework uses Actions to process HTML forms and other requests. The</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>Action
-</code></pre>
-</div>
-<p>class returns a result-name such as</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>SUCCESS
-</code></pre>
-</div>
-<p>,</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>ERROR
-</code></pre>
-</div>
-<p>, or</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>INPUT
-</code></pre>
-</div>
-<p>. Based on the mappings loaded from the</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>struts.xml
-</code></pre>
-</div>
-<p>, a given result-name may select a page (as in this example), another action, or some other web resource (image, PDF).</p>
+<p>The framework uses Actions to process HTML forms and other requests. The <code class="highlighter-rouge">Action</code> class returns a result-name such as <code class="highlighter-rouge">SUCCESS</code>, <code class="highlighter-rouge">ERROR</code> or <code class="highlighter-rouge">INPUT</code>. Based on the mappings loaded from the <code class="highlighter-rouge">struts.xml</code>, a given result-name may select a page (as in this example), another action, or some other web resource (image, PDF).</p>
 
 <p>When a server page is rendered, most often it will include dynamic data provided by the Action. To make it easy to display dynamic data, the framework provides a set of tags that can be used along with HTML markup to create a server page.</p>
 

Modified: websites/production/struts/content/getting-started/using-tags.html
==============================================================================
--- websites/production/struts/content/getting-started/using-tags.html (original)
+++ websites/production/struts/content/getting-started/using-tags.html Sat Apr  1 08:13:46 2017
@@ -123,74 +123,38 @@
   <section class="col-md-12">
     <h2 id="using-tags">Using Tags</h2>
 
-<p>This tutorial assumes you’ve completed the <a href="#PAGE_14811871">Hello World</a> tutorial and have a working helloworld project. The example code for this tutorial, using_tags, is available for checkout from the Struts 2 GitHub repository at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>. The example projects use Maven to manage the artifact dependencies and to build the .war files.</p>
+<p>This tutorial assumes you’ve completed the <a href="hello-world-using-struts2.html">Hello World</a> tutorial and have a working helloworld project. The example code for this tutorial, using_tags, is available for checkout from the Struts 2 GitHub repository at <a href="https://github.com/apache/struts-examples">https://github.com/apache/struts-examples</a>. The example projects use Maven to manage the artifact dependencies and to build the .war files.</p>
 
-<blockquote>
-
-</blockquote>
-
-<p>In the <a href="#PAGE_14811871">Hello World</a> lesson, we added to the index.jsp a Struts 2 url tag to create a hyperlink to the hello.action. This tutorial will explore the url and other Struts 2 tags further.</p>
+<p>In the <a href="hello-world-using-struts2.html">Hello World</a> lesson, we added to the index.jsp a Struts 2 url tag to create a hyperlink to the hello.action. This tutorial will explore the url and other Struts 2 tags further.</p>
 
 <p>Web applications differ from conventional websites in that web applications can create a dynamic response. To make it easier to reference dynamic data from a page, the Struts 2 framework offers a set of tags. Some of the tags mimic standard HTML tag while providing added value. Other tags create non-standard, but useful controls.</p>
 
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-  <p>To use the Struts 2 tags on the view page, you must include a tag library directive. Typically, the taglib directive is &lt;%@ taglib prefix=”s” uri=”/struts-tags” %&gt;. So the prefix for all the Struts 2 tags will be “s”.</p>
-</blockquote>
-
-<blockquote>
-  <p>If you want to actually read the Struts 2 tag TLD file, you’ll find it in the META-INF folder of the Struts 2 core jar.</p>
-</blockquote>
-
-<blockquote>
-
-</blockquote>
+<p>To use the Struts 2 tags on the view page, you must include a tag library directive. Typically, the taglib directive is <code class="highlighter-rouge">&lt;%@ taglib prefix="s" uri="/struts-tags" %\&gt;</code>. So the prefix for all the Struts 2 tags will be “s”. 
+If you want to actually read the Struts 2 tag TLD file, you’ll find it in the META-INF folder of the Struts 2 core jar.</p>
 
 <p><strong>Struts 2 url Tag</strong></p>
 
 <p>One use of the Struts 2 Tags is to create links to other web resources, especially to other resources in the local application.</p>
 
-<table>
-  <tbody>
-    <tr>
-      <td>While HTML provides a simple a tag for creating hyperlinks, the HTML tag often requires us to include redundant information. Also the HTML tag cannot easily access dynamic data provided by the framework.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
+<p>While HTML provides a simple a tag for creating hyperlinks, the HTML tag often requires us to include redundant information. Also the HTML tag cannot easily access dynamic data provided by the framework.</p>
 
-<p>A very common use case in web applications is linking to other pages. In the <em>Hello World</em>  tutorial we added to index.jsp a link to the hello.action using the Struts 2 url tag. Please refer to the <em>url documentation</em>  for more information about the url tag.</p>
+<p>A very common use case in web applications is linking to other pages. In the <a href="hello-world-using-struts2.html">Hello World</a> tutorial we added to index.jsp a link to the hello.action using the Struts 2 url tag. Please refer to the <em>url documentation</em>  for more information about the url tag.</p>
 
 <p><strong>index.jsp</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code><span class="err">&lt;</span>%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%&gt;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="err">&lt;</span>%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt;
 <span class="err">&lt;</span>%@ taglib prefix="s" uri="/struts-tags" %&gt;
 <span class="cp">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</span>
 <span class="nt">&lt;html&gt;</span>
-<span class="nt">&lt;head&gt;</span>
-<span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=ISO-8859-1"</span><span class="nt">&gt;</span>
-<span class="nt">&lt;title&gt;</span>Basic Struts 2 Application - Welcome<span class="nt">&lt;/title&gt;</span>
-<span class="nt">&lt;/head&gt;</span>
-<span class="nt">&lt;body&gt;</span>
-<span class="nt">&lt;h1&gt;</span>Welcome To Struts 2!<span class="nt">&lt;/h1&gt;</span>
-<span class="nt">&lt;p&gt;&lt;a</span> <span class="na">href=</span><span class="s">"&lt;s:url action='hello'/&gt;"</span><span class="nt">&gt;</span>Hello World<span class="nt">&lt;/a&gt;&lt;/p&gt;</span>
-<span class="nt">&lt;/body&gt;</span>
+  <span class="nt">&lt;head&gt;</span>
+    <span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=ISO-8859-1"</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;title&gt;</span>Basic Struts 2 Application - Welcome<span class="nt">&lt;/title&gt;</span>
+  <span class="nt">&lt;/head&gt;</span>
+  <span class="nt">&lt;body&gt;</span>
+    <span class="nt">&lt;h1&gt;</span>Welcome To Struts 2!<span class="nt">&lt;/h1&gt;</span>
+    <span class="nt">&lt;p&gt;&lt;a</span> <span class="na">href=</span><span class="s">"&lt;s:url action='hello'/&gt;"</span><span class="nt">&gt;</span>Hello World<span class="nt">&lt;/a&gt;&lt;/p&gt;</span>
+  <span class="nt">&lt;/body&gt;</span>
 <span class="nt">&lt;/html&gt;</span>
-
 </code></pre>
 </div>
 
@@ -201,11 +165,10 @@
 <p><strong>struts.xml</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;
+<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>
 
@@ -217,37 +180,21 @@
 
 <p><strong>url tag with param</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:url action="hello" var="helloLink"&gt;
-  &lt;s:param name="userName"&gt;Bruce Phillips&lt;/s:param&gt;
-&lt;/s:url&gt;
-
-&lt;p&gt;&lt;a href="${helloLink}"&gt;Hello Bruce Phillips&lt;/a&gt;&lt;/p&gt;
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:url</span> <span class="na">action=</span><span class="s">"hello"</span> <span class="na">var=</span><span class="s">"helloLink"</span><span class="nt">&gt;</span>
+  <span class="nt">&lt;s:param</span> <span class="na">name=</span><span class="s">"userName"</span><span class="nt">&gt;</span>Bruce Phillips<span class="nt">&lt;/s:param&gt;</span>
+<span class="nt">&lt;/s:url&gt;</span>
 
+<span class="nt">&lt;p&gt;&lt;a</span> <span class="na">href=</span><span class="s">"${helloLink}"</span><span class="nt">&gt;</span>Hello Bruce Phillips<span class="nt">&lt;/a&gt;&lt;/p&gt;</span>
 </code></pre>
 </div>
 
-<p>Rather then put the url tag as the value for the anchor tag’s href attribute, we’ve separated out the s:url tag into its own code block. Nested inside the url tag is the Struts 2 param tag. This tag lets you specify a parameter name (e.g. userName) and a value for that paramter (e.g. Bruce Phillips).</p>
+<p>Rather then put the url tag as the value for the anchor tag’s href attribute, we’ve separated out the s:url tag into its own code block. Nested inside the url tag is the Struts 2 param tag. This tag lets you specify a parameter name (e.g. userName) and a value for that parameter (e.g. Bruce Phillips).</p>
 
 <p>Notice the use of the var attribute. The value of the var attribute is a reference we can use later in our code to refer to the url created.</p>
 
-<p>Examine the anchor tag above. Notice the value of the href attribute is ${helloLink}. The view page will substitute the hyperlink we created using the url tag for the ${helloLink} reference. Note that the query string parameter will be properly URL-encoded (Bruce+Phillips).</p>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
+<p>Examine the anchor tag above. Notice the value of the href attribute is <code class="highlighter-rouge">${helloLink\}</code>. The view page will substitute the hyperlink we created using the url tag for the <code class="highlighter-rouge">${helloLink\}</code> reference. Note that the query string parameter will be properly URL-encoded (<code class="highlighter-rouge">Bruce+Phillips</code>).</p>
 
-</blockquote>
-
-<blockquote>
-  <p>In the next tutorial we’ll cover how Struts can access the query string parameter value.</p>
-</blockquote>
-
-<blockquote>
-
-</blockquote>
+<p>In the next tutorial we’ll cover how Struts can access the query string parameter value.</p>
 
 <p><strong>Struts 2 Form Tags</strong></p>
 
@@ -261,18 +208,15 @@
 
 <p><strong>Struts 2 Form</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;p&gt;Get your own personal hello by filling out and submitting this form.&lt;/p&gt;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;p&gt;</span>Get your own personal hello by filling out and submitting this form.<span class="nt">&lt;/p&gt;</span>
 
-&lt;s:form action="hello"&gt;
+<span class="nt">&lt;s:form</span> <span class="na">action=</span><span class="s">"hello"</span><span class="nt">&gt;</span>
 
-  &lt;s:textfield name="userName" label="Your name" /&gt;
+  <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>
 	
-   &lt;s:submit value="Submit" /&gt;
-
-&lt;/s:form&gt;
-
-
+  <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>
 
@@ -284,55 +228,39 @@
 
 <p><strong>Struts Form Tags Converted To HTML</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;form id="hello" name="hello" action="/Using_Tags_Struts2_Mvn/hello.action;jsessionid=3471d76027b5342cab44f297b567" method="post"&gt;
-
-&lt;table class="wwFormTable"&gt;
-
-&lt;tr&gt;
-    &lt;td class="tdLabel"&gt;&lt;label for="hello_userName" class="label"&gt;Your name:&lt;/label&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;input type="text" name="userName" value="" id="hello_userName"/&gt;&lt;/td&gt;
-&lt;/tr&gt;
-
-&lt;tr&gt;
-    &lt;td colspan="2"&gt;&lt;div align="right"&gt;&lt;input type="submit" id="hello_0" value="Submit"/&gt;
-&lt;/div&gt;&lt;/td&gt;
-&lt;/tr&gt;
-
-&lt;/table&gt;
-&lt;/form&gt;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;form</span> <span class="na">id=</span><span class="s">"hello"</span> <span class="na">name=</span><span class="s">"hello"</span> <span class="na">action=</span><span class="s">"/Using_Tags_Struts2_Mvn/hello.action;jsessionid=3471d76027b5342cab44f297b567"</span> <span class="na">method=</span><span class="s">"post"</span><span class="nt">&gt;</span>
 
+  <span class="nt">&lt;table</span> <span class="na">class=</span><span class="s">"wwFormTable"</span><span class="nt">&gt;</span>
 
+    <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;&lt;label</span> <span class="na">for=</span><span class="s">"hello_userName"</span> <span class="na">class=</span><span class="s">"label"</span><span class="nt">&gt;</span>Your name:<span class="nt">&lt;/label&gt;&lt;/td&gt;</span>
+      <span class="nt">&lt;td&gt;&lt;input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">name=</span><span class="s">"userName"</span> <span class="na">value=</span><span class="s">""</span> <span class="na">id=</span><span class="s">"hello_userName"</span><span class="nt">/&gt;&lt;/td&gt;</span>
+    <span class="nt">&lt;/tr&gt;</span>
+
+    <span class="nt">&lt;tr&gt;</span>
+      <span class="nt">&lt;td</span> <span class="na">colspan=</span><span class="s">"2"</span><span class="nt">&gt;</span>
+        <span class="nt">&lt;div</span> <span class="na">align=</span><span class="s">"right"</span><span class="nt">&gt;</span>
+          <span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"submit"</span> <span class="na">id=</span><span class="s">"hello_0"</span> <span class="na">value=</span><span class="s">"Submit"</span><span class="nt">/&gt;</span>
+        <span class="nt">&lt;/div&gt;</span>
+      <span class="nt">&lt;/td&gt;</span>
+    <span class="nt">&lt;/tr&gt;</span>
 
+  <span class="nt">&lt;/table&gt;</span>
+<span class="nt">&lt;/form&gt;</span>
 </code></pre>
 </div>
 
 <p>Note how Struts 2 created a table inside the form to position the form elements. In later tutorials you’ll learn how to specify the layout (table, CSS). The Struts 2 textfield tag created an HTML input tag of type text with a name value that matches the name value of the textfield tag. Struts 2 also created a label HTML tag based on the label value of the textfield tag.</p>
 
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-
-</blockquote>
-
-<blockquote>
-  <p>In the next tutorial we’ll cover how to use Struts 2 to process this form submission.</p>
-</blockquote>
-
-<blockquote>
-
-</blockquote>
+<p>In the next tutorial we’ll cover how to use Struts 2 to process this form submission.</p>
 
 <p><strong>Struts 2 property tag</strong></p>
 
-<p>In the <a href="#PAGE_14811871">Hello World</a> tutorial’s example application on JSP HelloWorld.jsp was this code:</p>
+<p>In the <a href="hello-world-using-struts2.html">Hello World</a> tutorial’s example application on JSP HelloWorld.jsp was this code:</p>
 
 <p><strong>Struts Property Tag</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;s:property value="messageStore.message" /&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;s:property</span> <span class="na">value=</span><span class="s">"messageStore.message"</span> <span class="nt">/&gt;</span>
 </code></pre>
 </div>
 
@@ -344,16 +272,15 @@
 
 <p><strong>Add Static Field</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>private static int helloCount = 0;
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="kd">private</span> <span class="kd">static</span> <span class="kt">int</span> <span class="n">helloCount</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>
 	
-public int getHelloCount() {
-	return helloCount;
-}
-
-public void setHelloCount(int helloCount) {
-	HelloWorldAction.helloCount = helloCount;
-}
-
+<span class="kd">public</span> <span class="kt">int</span> <span class="nf">getHelloCount</span><span class="p">(</span><span class="o">)</span> <span class="o">{</span>
+    <span class="k">return</span> <span class="n">helloCount</span><span class="o">;</span>
+<span class="o">}</span>
+
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">setHelloCount</span><span class="p">(</span><span class="kt">int</span> <span class="n">helloCount</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">HelloWorldAction</span><span class="o">.</span><span class="na">helloCount</span> <span class="o">=</span> <span class="n">helloCount</span><span class="o">;</span>
+<span class="o">}</span>
 </code></pre>
 </div>
 
@@ -361,9 +288,7 @@ public void setHelloCount(int helloCount
 
 <p><strong>Increase helloCount</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>helloCount++;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="n">helloCount</span><span class="o">++;</span>
 </code></pre>
 </div>
 
@@ -373,40 +298,21 @@ public void setHelloCount(int helloCount
 
 <p><strong>Use Property Tag To Display helloCount Value</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;p&gt;I've said hello &lt;s:property value="helloCount" /&gt; times!&lt;/p&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;p&gt;</span>I've said hello <span class="nt">&lt;s:property</span> <span class="na">value=</span><span class="s">"helloCount"</span> <span class="nt">/&gt;</span> times!<span class="nt">&lt;/p&gt;</span>
 </code></pre>
 </div>
 
 <p>So even though the getHelloCount method returns an integer type, Struts 2 converted it to type String and placed it into the body of the p tag.</p>
 
-<table>
-  <tbody>
-    <tr>
-      <td>Note that even though helloCount is a static field, the get and set methods for helloCount are not static. For Struts 2 to call the getHelloCount method to get the value of helloCount, the getHelloCount method cannot be static.</td>
-    </tr>
-  </tbody>
-</table>
-
-<table>
-  <tbody>
-    <tr>
-    </tr>
-  </tbody>
-</table>
+<p>Note that even though helloCount is a static field, the get and set methods for helloCount are not static. For Struts 2 to call the getHelloCount method to get the value of helloCount, the getHelloCount method cannot be static.</p>
 
 <p>If the value returned by the get method is an object, then the property tag will cause Struts 2 to call the object’s toString method. Of course, you should always override Class Object’s toString method in your model classes. Add the following toString method to the MessageStore class:</p>
 
 <p><strong>Add toString Method To Class MessageStore</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>public String toString() {
-		
-	return message + " (from toString)";
-		
-}	
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="kd">public</span> <span class="n">String</span> <span class="nf">toString</span><span class="p">(</span><span class="o">)</span> <span class="o">{</span>
+    <span class="k">return</span> <span class="n">message</span> <span class="o">+</span> <span class="s">" (from toString)"</span><span class="o">;</span>
+<span class="o">}</span>	
 </code></pre>
 </div>
 
@@ -414,9 +320,7 @@ public void setHelloCount(int helloCount
 
 <p><strong>Using Property Tag to Call toString</strong></p>
 
-<div class="highlighter-rouge"><pre class="highlight"><code>&lt;p&gt;&lt;s:property value="messageStore" /&gt;&lt;/p&gt;
-
-
+<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;p&gt;&lt;s:property</span> <span class="na">value=</span><span class="s">"messageStore"</span> <span class="nt">/&gt;&lt;/p&gt;</span>
 </code></pre>
 </div>
 



Mime
View raw message