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/03/31 05:48:14 UTC

[12/13] struts-site git commit: Migrates Getting started guide from Confluence to MD

Migrates Getting started guide from Confluence to MD


Project: http://git-wip-us.apache.org/repos/asf/struts-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-site/commit/39272be0
Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/39272be0
Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/39272be0

Branch: refs/heads/master
Commit: 39272be053d35f57124d7af324147f6f21db2f61
Parents: a7e372d
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Fri Mar 31 07:43:11 2017 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Fri Mar 31 07:43:11 2017 +0200

----------------------------------------------------------------------
 source/_includes/header.html                    |   2 +-
 source/getting-started/annotations.md           | 363 ++++++++++++++
 .../att14974990_Basic_Strut2_Ant_Structure.png  | Bin 0 -> 23368 bytes
 .../att14974991_Basic_Struts2_Welcome.png       | Bin 0 -> 17245 bytes
 .../att14974992_Basic_Struts2_Mvn.png           | Bin 0 -> 18234 bytes
 .../attachments/att14974993_Hello.png           | Bin 0 -> 13038 bytes
 .../att14974994_Struts2HelloWorld.png           | Bin 0 -> 20676 bytes
 .../att14974995_displaymessagestore.png         | Bin 0 -> 19502 bytes
 .../attachments/att14974996_Struts Form.png     | Bin 0 -> 30091 bytes
 .../attachments/att14974997_hellobruce.png      | Bin 0 -> 22022 bytes
 .../attachments/att14974998_personalhello.png   | Bin 0 -> 20825 bytes
 .../attachments/att14974999_registerjsp.png     | Bin 0 -> 13152 bytes
 .../attachments/att14975000_thanyoujsp.png      | Bin 0 -> 14971 bytes
 .../att14975001_form_errors_styled.png          | Bin 0 -> 29178 bytes
 .../attachments/att14975003_form_errors.png     | Bin 0 -> 29272 bytes
 .../attachments/att14975004_contact.png         | Bin 0 -> 39572 bytes
 .../attachments/att14975005_hellogreeting.png   | Bin 0 -> 30166 bytes
 .../attachments/att14975006_register.png        | Bin 0 -> 24054 bytes
 .../attachments/att14975007_registerInput.png   | Bin 0 -> 35660 bytes
 .../attachments/att14975008_spanishform.png     | Bin 0 -> 29064 bytes
 .../attachments/att14975009_thankyou.png        | Bin 0 -> 25501 bytes
 .../att17137672_debuging-struts-1.png           | Bin 0 -> 49242 bytes
 .../att17137673_debuging-struts-2.png           | Bin 0 -> 79192 bytes
 .../att17137674_debuging-struts-3.png           | Bin 0 -> 167300 bytes
 ...802_Screen shot 2010-04-25 at 8.39.59 AM.png | Bin 0 -> 31990 bytes
 .../att20873263_form-validation-1.png           | Bin 0 -> 42860 bytes
 .../att20873264_form-validation-2.png           | Bin 0 -> 16981 bytes
 .../att20873265_form-validation-3.png           | Bin 0 -> 17160 bytes
 ...805_Screen shot 2010-05-30 at 8.51.40 AM.png | Bin 0 -> 23189 bytes
 ...57_Screen shot 2010-09-11 at 12.37.12 PM.png | Bin 0 -> 12576 bytes
 ...43_Screen shot 2010-10-24 at 10.51.45 AM.png | Bin 0 -> 31742 bytes
 ...281_Screen shot 2012-02-17 at 2.46.54 PM.png | Bin 0 -> 19615 bytes
 source/getting-started/coding-actions.md        | 177 +++++++
 source/getting-started/control-tags.md          |  93 ++++
 source/getting-started/debugging-struts.md      |  70 +++
 source/getting-started/exception-handling.md    | 118 +++++
 source/getting-started/exclude-parameters.md    | 102 ++++
 source/getting-started/form-tags.md             | 239 +++++++++
 .../form-validation-using-xml.md                | 146 ++++++
 source/getting-started/form-validation.md       | 125 +++++
 source/getting-started/getting-started.md       |  62 +++
 .../hello-world-using-struts2.md                | 480 +++++++++++++++++++
 .../how-to-create-a-struts2-web-application.md  | 226 +++++++++
 source/getting-started/http-session.md          | 154 ++++++
 .../getting-started/introducing-interceptors.md | 187 ++++++++
 .../getting-started/message-resource-files.md   | 269 +++++++++++
 source/getting-started/preperable-interface.md  |  53 ++
 source/getting-started/processing-forms.md      | 270 +++++++++++
 source/getting-started/spring.md                | 224 +++++++++
 source/getting-started/themes.md                | 177 +++++++
 source/getting-started/unit-testing.md          | 144 ++++++
 source/getting-started/using-tags.md            | 276 +++++++++++
 .../wildcard-method-selection.md                |  88 ++++
 53 files changed, 4044 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/_includes/header.html
----------------------------------------------------------------------
diff --git a/source/_includes/header.html b/source/_includes/header.html
index 2410a11..e9908c0 100644
--- a/source/_includes/header.html
+++ b/source/_includes/header.html
@@ -65,7 +65,7 @@
                 <li><a href="/docs/tag-reference.html">Tag reference</a></li>
                 <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li>
                 <li class="divider"></li>
-                <li><a href="/new-docs/getting-started.html">Getting Started (WIP)</a></li>
+                <li><a href="/getting-started/getting-started.html">Getting Started (WIP)</a></li>
               </ul>
             </li>
             <li class="dropdown">

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/annotations.md
----------------------------------------------------------------------
diff --git a/source/getting-started/annotations.md b/source/getting-started/annotations.md
new file mode 100644
index 0000000..36f3ebb
--- /dev/null
+++ b/source/getting-started/annotations.md
@@ -0,0 +1,363 @@
+---
+layout: default
+title: Annotations
+---
+## Annotations
+
+The example code for this tutorial, annotations, is available for checkout at [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples)
+
+> 
+
+#####Introduction#####
+
+In our previous tutorials we've been using an XML file (struts.xml) to configure our applications. The XML file wires up the action names (register), with ActionSupport classes (RegisterAction.java), and with the result to render back to the browser (register.jsp). Struts 2 provides an alternative to using XML to configure your application by using standard naming conventions and annotations for your action names, ActionSupport classes, and results.
+
+
+> 
+
+> 
+
+> This tutorial assumes you understand how to apply annotations to Java classes and methods. If you're not familiar with annotations, consult the [Java online tutorial](http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html)^[http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html].
+
+> 
+
+
+| 
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Struts 2 Convention Plugin#####
+
+Struts 2 enables the use of standard naming conventions and annotations when you include the Convention plugin in your application's class path. If you're using Maven you'll need to add a dependency:
+
+**Convention Plugin Dependency**
+
+
+~~~~~~~
+<dependency>
+  <groupId>org.apache.struts</groupId>
+  <artifactId>struts2-convention-plugin</artifactId>
+  <version>2.2.1</version>
+</dependency>
+
+
+~~~~~~~
+
+If you're using Ant then copy the struts2-convention-plugin jar file from the Struts 2 download to your WEB-INF/lib folder.
+
+
+
+| The convention plugin provide several different ways you can configure your Struts 2 application without using XML. Consult the _Convention Plugin_  documentation for complete details. This tutorial only examines one simple way of following the conventions provided by the Convention plugin.
+
+| 
+
+When you run the example application you'll see on the index.jsp page a link to Get your hello. This URL for the link is hello.action. When you click on this link, the execute method of class HelloAction.java (which is a Struts 2 ActionSupport class) is run. The view page rendered back to the browser after the execute method returns success is hello-success.jsp.
+
+None of the above is wired up using XML but rather happens because the application follows the standard naming conventions expected by the Convention plugin. The first convention is that the ActionSupport class, HelloAction.java, is in package org.apache.struts.struts2annotations.action. One of the Convention plugin's defaults is to look for ActionSupport classes that are in package structure that ends in action. The next convention the application follows is that HelloAction.java extends the ActionSupport class and defines an execute method. The link is hello.action. When the Struts 2 filter sees a request for hello.action it will map that request to the HelloAction class's execute method due to the Convention plugin being used.
+
+So a link of hello.action causes the execute method of class HelloAction to be run. That method returns "success." Because the application is using the Convention plugin, Struts 2 will render back to the browser a view page named hello-success.jsp that is located in WEB-INF/content (by default the Convention plugin expects all view pages to be in this location). If the execute method returns "input" or "error" then the view page rendered would have been hello-input.jsp or hello-error.jsp.
+
+#####Struts 2 Configuration Plugin#####
+
+In a [previous tutorial](#PAGE_16941310) we reviewed how to use the Struts 2 Configuration plugin to view the details of how Struts 2 has configured your application. When using the Convention plugin, it's very handy to also use the Configuration plugin during development. On the example application's home page is a link to the application's configuration. Click on that link and then the hello link on the left menu (under Actions in default). You'll see the configuration for the hello action including it's Action class, result, and view page.
+
+![Screen shot 2010-10-24 at 10.51.45 AM.png](attachments/att24346643_Screen shot 2010-10-24 at 10.51.45 AM.png)
+
+#####Annotations#####
+
+If you want to go beyond the simple naming conventions provided by the Convention plugin, you can use the Struts 2 annotations also provided by the plugin. For example, a common work-flow for a Struts 2 application is to first execute the ActionSupport class's input method to setup form field default values and then to run the execute method of the same ActionSupport class when the form is submitted (to validate and save the user's input).
+
+The link to Register for the drawing on the example application's home page follows this work flow. The link value is register-input.action. If you examine the RegisterAction.java class you'll find the input method with an Action annotation.
+
+**Action Annotation**
+
+
+~~~~~~~
+@Action("register-input")
+public String input() throws Exception {
+
+	logger.info("In input method of class Register");
+		
+	return INPUT;
+}
+
+
+~~~~~~~
+
+The Action annotation tells Struts 2 to execute the annotated method when the action link value equals the Action annotation's value ("register-input"). So a link of register-input.action will call the input method of class RegisterAction. On the example application's home page is a link to Register for the drawing with a URL of register-input.action.
+
+The input method above returns "input". By the standards of the Convention plugin, the view page rendered will be register-input.jsp (from WEB-INF/content). On that view page is a Struts 2 form tag with an action attribute value of register. When submitting the form, the execute method of class RegisterAction will be run. Since the execute method returns success, the view page rendered is register-success.jsp.
+
+#####Struts 2 Configuration Values#####
+
+In previous examples, we included in struts.xml values for some of the Struts 2 configuration parameters.
+
+**struts.xml parameter configuration**
+
+
+~~~~~~~
+<constant name="struts.devMode" value="true" />
+
+
+~~~~~~~
+
+When we don't use a struts.xml file, we can set the value of these Struts 2 parameters by using filter parameters in web.xml:
+
+**Struts 2 Parameter Configurate web.xml**
+
+
+~~~~~~~
+<filter>
+  <filter-name>struts2</filter-name>
+    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+      <init-param>
+	  <param-name>struts.devMode</param-name>
+	  <param-value>true</param-value>
+      </init-param>
+</filter>
+
+
+~~~~~~~
+
+#####Summary#####
+
+We've just scratched the surface of what the Struts 2 convention plugin provides to reduce or eliminate the need to use an XML file to configure your Struts 2 application. The Struts 2 Convention plugin provides ways to map multiple actions to the same method, map results to different view pages, map errors to view pages, and much more. Be sure to read through the _Convention Plugin_  documentation for alternative ways to configure your Struts 2 application.
+
+##Struts 2 Form Tags## {#PAGE_19300595}
+
+The example code for this tutorial, form_tags, can be checked out from [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+> 
+
+#####Introduction#####
+
+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 (_Processing Forms_ , _Form Validation_ , and _Message Resource Files_ ) 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.
+
+
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Example Application#####
+
+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.
+
+To enable the user to edit his information that is stored in the Person object, we need to create a form like this one:
+
+![Screen shot 2010-04-25 at 8.39.59 AM.png](attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png)
+
+The form allows the user to make changes. After submitting the form, the Struts 2 framework will update the state of the Person object.
+
+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.
+
+#####Struts 2 Select Tag#####
+
+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.
+
+**Struts 2 Select Tag**
+
+
+~~~~~~~
+<s:select key="personBean.sport" list="sports" />
+
+
+~~~~~~~
+
+In these form tags, we are using the key attribute as discussed in the _Message Resource Files_  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 _Message Resource Files_  tutorial for information on using Struts 2 property files).
+
+
+> 
+
+> 
+
+> 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.
+
+> 
+
+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.
+
+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".
+
+Here is the HTML that results from using the above Struts 2 select tag.
+
+**HTML Created By Struts 2 Select Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_sport" class="label">Favorite sport:</label>
+</td>
+<td>
+<select name="personBean.sport" id="save_personBean_sport">
+    <option value="football">football</option>
+    <option value="baseball">baseball</option>
+    <option value="basketball" selected="selected">basketball</option>
+</select>
+</td>
+</tr>
+
+
+~~~~~~~
+
+Note the table formatting created by the Struts 2 framework when using the Struts 2 select tag. The CSS classes are defined in style sheets included by the Struts 2 s:head tag. The Struts 2 s:head tag is placed inside the edit.jsp's head section.
+
+Since the personBean's getSport method returns "baskeball", the basketball option value is marked as selected.
+
+#####Struts 2 Radio Tag#####
+
+The Struts 2 radio tag\u2014like its standard HTML counterpart\u2014is 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.
+
+**Struts 2 Radio Tag**
+
+
+~~~~~~~
+<s:radio key="personBean.gender" list="genders" />
+
+
+~~~~~~~
+
+Again the key attribute's value determines the value for the label and value attributes. The label's text is derived from the EditAction.properties file (key personBean.gender). Just like the Struts 2 select tag, the list attribute of the Struts 2 radio tag causes the framework to call the getGenders method of the EditAction class. The Array of String objects returned are used to create the individual radio buttons.
+
+**HTML Created By Struts 2 Radio Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_gender" class="label">Gender:</label></td>
+<td>
+<input type="radio" name="personBean.gender" id="save_personBean_gendermale" value="male"/><label for="save_personBean_gendermale">male</label>
+<input type="radio" name="personBean.gender" id="save_personBean_genderfemale" value="female"/><label for="save_personBean_genderfemale">female</label>
+<input type="radio" name="personBean.gender" id="save_personBean_gendernot sure" checked="checked" value="not sure"/><label for="save_personBean_gendernot sure">not sure</label>
+</td>
+</tr>
+
+
+~~~~~~~
+
+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.
+
+#####Struts 2 Select Tag - Object Backed#####
+
+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
+
+**Struts 2 Select Tag Object Backed**
+
+
+~~~~~~~
+<s:select key="personBean.residency" list="states" listKey="stateAbbr" listValue="stateName" />
+
+
+~~~~~~~
+
+The list value tells the framework to call the getStates method of the EditAction class. That method returns an ArrayList of State objects. Each State object has getStateAbbr and getStateName methods.
+
+The listKey attribute tells the framework to use the value returned by calling the getStateAbbr method as the value for the value attribute of the HTML option tag and the value returned by calling the getStateName method as the value displayed to the user. So the above Struts 2 select tag code results in this HTML.
+
+**HTML Created By Struts 2 Select Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_residency" class="label">State resident:</label></td>
+<td>
+<select name="personBean.residency" id="save_personBean_residency">
+    <option value="AZ">Arizona</option>
+    <option value="CA">California</option>
+    <option value="FL">Florida</option>
+    <option value="KS" selected="selected">Kansas</option>
+    <option value="NY">New York</option>
+</select>
+</td>
+</tr>
+
+
+~~~~~~~
+
+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.
+
+#####Struts 2 Checkbox Tag#####
+
+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.
+
+**Struts 2 Checkbox Tag**
+
+
+~~~~~~~
+<s:checkbox key="personBean.over21" />
+
+
+~~~~~~~
+
+Since the method getOver21 returns true, the checkbox is checked.
+
+**HTML Created By Struts 2 Checkbox Tag**
+
+
+~~~~~~~
+<tr>
+<td valign="top" align="right">
+</td>
+<td valign="top" align="left">
+<input type="checkbox" name="personBean.over21" value="true" checked="checked" id="save_personBean_over21"/>
+<input type="hidden" id="__checkbox_save_personBean_over21" name="__checkbox_personBean.over21" value="true" />  <label for="save_personBean_over21" class="checkboxLabel">21 or older</label>
+</td>
+</tr>
+
+
+~~~~~~~
+
+When the form is submitted and the checkbox is not checked, no value will be posted for the checkbox (this is how HTML forms work). Since the Struts 2 framework will need to update the value of the personBean's over21 instance field to false\u2014given that the check box was not checked\u2014the framework needs a way to determine if the checkbox was not checked after form submission.
+
+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.
+
+#####Struts 2 checkboxlist Tag#####
+
+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.
+
+Using the Struts 2 checkbox tag, we can create a series of checkboxes, one for each possible car model the user may own. The value of each String in the personBean's carModels Array will determine which checkboxes are checked.
+
+**Struts 2 Checkboxlist Tag**
+
+
+~~~~~~~
+<s:checkboxlist key="personBean.carModels" list="carModelsAvailable" />
+
+
+~~~~~~~
+
+The list attributes value in the checkboxlist tag tells the Struts 2 framework which method to call to get the possible car models. In the example application, the framework will call the EditAction class's getCarModelsAvailable method. That method returns an Array of Strings. For each element of the Array, the Struts 2 framework creates a checkbox (including the associated hidden field described above).
+
+The key attribute value in the checkboxlist tag tells the Struts 2 framework which method to call on the personBean object to determine which checkboxes should be checked. In the example application, the framework will call the personBean object's getCarModels method. The getCarModels method returns an Array of Strings. For each String value in that Array that matches a String value in the Array returned by the EditAction class's getCarModelsAvailable, the checkbox will be checked.
+
+**HTML Created By Struts 2 Checkboxlist Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_carModels" class="label">Car models owned:</label></td>
+<td>
+<input type="checkbox" name="personBean.carModels" value="Ford" id="personBean.carModels-1" checked="checked"/>
+<label for="personBean.carModels-1" class="checkboxLabel">Ford</label>
+<input type="checkbox" name="personBean.carModels" value="Chrysler" id="personBean.carModels-2"/>
+<label for="personBean.carModels-2" class="checkboxLabel">Chrysler</label>
+<input type="checkbox" name="personBean.carModels" value="Toyota" id="personBean.carModels-3"/>
+<label for="personBean.carModels-3" class="checkboxLabel">Toyota</label>
+<input type="checkbox" name="personBean.carModels" value="Nissan" id="personBean.carModels-4" checked="checked"/>
+<label for="personBean.carModels-4" class="checkboxLabel">Nissan</label>
+<input type="hidden" id="__multiselect_save_personBean_carModels" name="__multiselect_personBean.carModels" value="" />
+</td>
+</tr>
+
+
+~~~~~~~
+
+Summary
+ There are several other Struts 2 form controls you should explore. If you need more information about the Struts 2 form tags consult the Struts 2 documentation at [http://struts.apache.org](http://struts.apache.org).
+

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974990_Basic_Strut2_Ant_Structure.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974990_Basic_Strut2_Ant_Structure.png b/source/getting-started/attachments/att14974990_Basic_Strut2_Ant_Structure.png
new file mode 100644
index 0000000..096c54e
Binary files /dev/null and b/source/getting-started/attachments/att14974990_Basic_Strut2_Ant_Structure.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974991_Basic_Struts2_Welcome.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974991_Basic_Struts2_Welcome.png b/source/getting-started/attachments/att14974991_Basic_Struts2_Welcome.png
new file mode 100644
index 0000000..a31fd34
Binary files /dev/null and b/source/getting-started/attachments/att14974991_Basic_Struts2_Welcome.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974992_Basic_Struts2_Mvn.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974992_Basic_Struts2_Mvn.png b/source/getting-started/attachments/att14974992_Basic_Struts2_Mvn.png
new file mode 100644
index 0000000..4b2bdb3
Binary files /dev/null and b/source/getting-started/attachments/att14974992_Basic_Struts2_Mvn.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974993_Hello.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974993_Hello.png b/source/getting-started/attachments/att14974993_Hello.png
new file mode 100644
index 0000000..d36de44
Binary files /dev/null and b/source/getting-started/attachments/att14974993_Hello.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974994_Struts2HelloWorld.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974994_Struts2HelloWorld.png b/source/getting-started/attachments/att14974994_Struts2HelloWorld.png
new file mode 100644
index 0000000..5388697
Binary files /dev/null and b/source/getting-started/attachments/att14974994_Struts2HelloWorld.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974995_displaymessagestore.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974995_displaymessagestore.png b/source/getting-started/attachments/att14974995_displaymessagestore.png
new file mode 100644
index 0000000..c1f3064
Binary files /dev/null and b/source/getting-started/attachments/att14974995_displaymessagestore.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974996_Struts Form.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974996_Struts Form.png b/source/getting-started/attachments/att14974996_Struts Form.png
new file mode 100644
index 0000000..8aad998
Binary files /dev/null and b/source/getting-started/attachments/att14974996_Struts Form.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974997_hellobruce.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974997_hellobruce.png b/source/getting-started/attachments/att14974997_hellobruce.png
new file mode 100644
index 0000000..835e1a8
Binary files /dev/null and b/source/getting-started/attachments/att14974997_hellobruce.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974998_personalhello.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974998_personalhello.png b/source/getting-started/attachments/att14974998_personalhello.png
new file mode 100644
index 0000000..6045372
Binary files /dev/null and b/source/getting-started/attachments/att14974998_personalhello.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14974999_registerjsp.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14974999_registerjsp.png b/source/getting-started/attachments/att14974999_registerjsp.png
new file mode 100644
index 0000000..a561f6c
Binary files /dev/null and b/source/getting-started/attachments/att14974999_registerjsp.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975000_thanyoujsp.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975000_thanyoujsp.png b/source/getting-started/attachments/att14975000_thanyoujsp.png
new file mode 100644
index 0000000..90ca8ac
Binary files /dev/null and b/source/getting-started/attachments/att14975000_thanyoujsp.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975001_form_errors_styled.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975001_form_errors_styled.png b/source/getting-started/attachments/att14975001_form_errors_styled.png
new file mode 100644
index 0000000..c7be09a
Binary files /dev/null and b/source/getting-started/attachments/att14975001_form_errors_styled.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975003_form_errors.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975003_form_errors.png b/source/getting-started/attachments/att14975003_form_errors.png
new file mode 100644
index 0000000..c135558
Binary files /dev/null and b/source/getting-started/attachments/att14975003_form_errors.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975004_contact.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975004_contact.png b/source/getting-started/attachments/att14975004_contact.png
new file mode 100644
index 0000000..380414e
Binary files /dev/null and b/source/getting-started/attachments/att14975004_contact.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975005_hellogreeting.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975005_hellogreeting.png b/source/getting-started/attachments/att14975005_hellogreeting.png
new file mode 100644
index 0000000..f9948b7
Binary files /dev/null and b/source/getting-started/attachments/att14975005_hellogreeting.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975006_register.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975006_register.png b/source/getting-started/attachments/att14975006_register.png
new file mode 100644
index 0000000..3943c2a
Binary files /dev/null and b/source/getting-started/attachments/att14975006_register.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975007_registerInput.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975007_registerInput.png b/source/getting-started/attachments/att14975007_registerInput.png
new file mode 100644
index 0000000..080c960
Binary files /dev/null and b/source/getting-started/attachments/att14975007_registerInput.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975008_spanishform.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975008_spanishform.png b/source/getting-started/attachments/att14975008_spanishform.png
new file mode 100644
index 0000000..8c2e424
Binary files /dev/null and b/source/getting-started/attachments/att14975008_spanishform.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att14975009_thankyou.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att14975009_thankyou.png b/source/getting-started/attachments/att14975009_thankyou.png
new file mode 100644
index 0000000..63e12db
Binary files /dev/null and b/source/getting-started/attachments/att14975009_thankyou.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att17137672_debuging-struts-1.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att17137672_debuging-struts-1.png b/source/getting-started/attachments/att17137672_debuging-struts-1.png
new file mode 100644
index 0000000..8262e39
Binary files /dev/null and b/source/getting-started/attachments/att17137672_debuging-struts-1.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att17137673_debuging-struts-2.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att17137673_debuging-struts-2.png b/source/getting-started/attachments/att17137673_debuging-struts-2.png
new file mode 100644
index 0000000..985e56a
Binary files /dev/null and b/source/getting-started/attachments/att17137673_debuging-struts-2.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att17137674_debuging-struts-3.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att17137674_debuging-struts-3.png b/source/getting-started/attachments/att17137674_debuging-struts-3.png
new file mode 100644
index 0000000..b386cbc
Binary files /dev/null and b/source/getting-started/attachments/att17137674_debuging-struts-3.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png b/source/getting-started/attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png
new file mode 100644
index 0000000..3ae12c4
Binary files /dev/null and b/source/getting-started/attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att20873263_form-validation-1.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att20873263_form-validation-1.png b/source/getting-started/attachments/att20873263_form-validation-1.png
new file mode 100644
index 0000000..226cc1c
Binary files /dev/null and b/source/getting-started/attachments/att20873263_form-validation-1.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att20873264_form-validation-2.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att20873264_form-validation-2.png b/source/getting-started/attachments/att20873264_form-validation-2.png
new file mode 100644
index 0000000..16afdaa
Binary files /dev/null and b/source/getting-started/attachments/att20873264_form-validation-2.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att20873265_form-validation-3.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att20873265_form-validation-3.png b/source/getting-started/attachments/att20873265_form-validation-3.png
new file mode 100644
index 0000000..ecb5912
Binary files /dev/null and b/source/getting-started/attachments/att20873265_form-validation-3.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att21921805_Screen shot 2010-05-30 at 8.51.40 AM.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att21921805_Screen shot 2010-05-30 at 8.51.40 AM.png b/source/getting-started/attachments/att21921805_Screen shot 2010-05-30 at 8.51.40 AM.png
new file mode 100644
index 0000000..5678a53
Binary files /dev/null and b/source/getting-started/attachments/att21921805_Screen shot 2010-05-30 at 8.51.40 AM.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att23527657_Screen shot 2010-09-11 at 12.37.12 PM.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att23527657_Screen shot 2010-09-11 at 12.37.12 PM.png b/source/getting-started/attachments/att23527657_Screen shot 2010-09-11 at 12.37.12 PM.png
new file mode 100644
index 0000000..8bbfcb9
Binary files /dev/null and b/source/getting-started/attachments/att23527657_Screen shot 2010-09-11 at 12.37.12 PM.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att24346643_Screen shot 2010-10-24 at 10.51.45 AM.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att24346643_Screen shot 2010-10-24 at 10.51.45 AM.png b/source/getting-started/attachments/att24346643_Screen shot 2010-10-24 at 10.51.45 AM.png
new file mode 100644
index 0000000..5fc9a8a
Binary files /dev/null and b/source/getting-started/attachments/att24346643_Screen shot 2010-10-24 at 10.51.45 AM.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/attachments/att28017281_Screen shot 2012-02-17 at 2.46.54 PM.png
----------------------------------------------------------------------
diff --git a/source/getting-started/attachments/att28017281_Screen shot 2012-02-17 at 2.46.54 PM.png b/source/getting-started/attachments/att28017281_Screen shot 2012-02-17 at 2.46.54 PM.png
new file mode 100644
index 0000000..242ee21
Binary files /dev/null and b/source/getting-started/attachments/att28017281_Screen shot 2012-02-17 at 2.46.54 PM.png differ

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/coding-actions.md
----------------------------------------------------------------------
diff --git a/source/getting-started/coding-actions.md b/source/getting-started/coding-actions.md
new file mode 100644
index 0000000..8a9b04a
--- /dev/null
+++ b/source/getting-started/coding-actions.md
@@ -0,0 +1,177 @@
+---
+layout: default
+title: Coding actions
+---
+## Coding actions
+
+This tutorial assumes you've completed the [Using Struts 2 Tags](#PAGE_14811875) tutorial and have a working using_tags project. The example code for this tutorial, coding_action, is available for checkout from the Struts 2 GitHub repository: [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+> 
+
+__Introduction__
+
+Coding a Struts 2 Action involves several parts:
+
+1. Mapping an action to a class
+ 2. Mapping a result to a view
+ 3. Writing the controller logic in the Action class
+
+In the previous tutorials we covered how to configure Struts to map a URL such as hello.action to a Action class such as HelloWorldAction (specifically the execute method).
+
+**Action Mapping**
+
+
+~~~~~~~
+<action name="hello" class="org.apache.struts.helloworld.action.HelloWorldAction" method="execute">
+	<result name="success">/HelloWorld.jsp</result>
+</action>
+
+
+~~~~~~~
+
+The Action mapping above also specified that if the execute method of class HelloWorldAction returns success then the view HelloWorld.jsp will be returned to the browser.
+
+This tutorial will introduce you to the basics of writing the controller logic in the Action class.
+
+__Struts 2 Action Classes__
+
+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.
+
+Struts 2 Action classes usually extend the 
+
+~~~~~~~
+ActionSupport
+~~~~~~~
+ class, which is provided by the Struts 2 framework. Class 
+
+~~~~~~~
+ActionSupport
+~~~~~~~
+ 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 
+
+~~~~~~~
+ActionSupport
+~~~~~~~
+ your class can either override the default implementations or inherit them.
+
+If you examine class HelloWorldAction from tutorial [Using Struts 2 Tags](#PAGE_14811875) you'll see that it extends class 
+
+~~~~~~~
+ActionSupport
+~~~~~~~
+ and then overrides method execute.
+
+In method execute is where we placed what we want this controller to do in response to the hello.action.
+
+**Method execute of HelloWorldAction**
+
+
+~~~~~~~
+public String execute() throws Exception {
+		
+	messageStore = new MessageStore() ;
+		
+	helloCount++;
+		
+	return SUCCESS;
+
+}
+
+
+~~~~~~~
+
+
+> 
+
+> 
+
+> 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.
+
+> 
+
+__Processing Form Input In The Action Class__
+
+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."
+
+In the [Using Struts 2 Tags](#PAGE_14811875) example application we added a Struts 2 form to index.jsp.
+
+**Struts 2 Form Tags**
+
+
+~~~~~~~
+<s:form action="hello">
+
+	<s:textfield name="userName" label="Your name" />
+	
+	<s:submit value="Submit" />
+
+</s:form>
+
+
+
+~~~~~~~
+
+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.
+
+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 [Hello World](#PAGE_14811871)).
+
+For the example application associated with this tutorial add the following Java code to class HelloWorldAction.
+
+**Add userName to HelloWorldAction**
+
+
+~~~~~~~
+	private String userName;
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+
+~~~~~~~
+
+To personalize the MessageStore message (recall that class MessageStore is storing the message to display) add the following Java code to the HelloWorldAction's execute method after the statement that instantiates the MessageStore object.
+
+**Add userName value to message**
+
+
+~~~~~~~
+if (userName != null) {
+			
+	messageStore.setMessage( messageStore.getMessage() + " " + userName);
+			
+}
+
+
+~~~~~~~
+
+Now build and deploy the application. Enter your name in the form and click the submit button. You should see the following page.
+
+![personalhello.png](attachments/att14974998_personalhello.png)
+
+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.
+
+On the index.jsp we also have a Struts 2 action link (see tutorial [Using Struts 2 Tags](#PAGE_14811875)) that includes a query string parameter: userName=Bruce\+Phillips. If you click on that link you should see the result of:
+
+![hellobruce.png](attachments/att14974997_hellobruce.png)
+
+Since the query string parameter is userName, Struts passed the value of that parameter to the setUserName method.
+
+
+> 
+
+> 
+
+> On the view page, HelloWorld.jsp, you can also access the userName value by using the Struts 2 property tag (see tutorial [Using Struts 2 Tags](#PAGE_14811875)). Try showing just the userName value on the view page.
+
+> 
+
+__Summary__
+
+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.
+

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/control-tags.md
----------------------------------------------------------------------
diff --git a/source/getting-started/control-tags.md b/source/getting-started/control-tags.md
new file mode 100644
index 0000000..eb8e54e
--- /dev/null
+++ b/source/getting-started/control-tags.md
@@ -0,0 +1,93 @@
+---
+layout: default
+title: Control tags
+---
+## Control Tags
+
+The example code for this tutorial, control_tags, is available at [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples)
+
+> 
+
+#####Introduction#####
+
+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 [tags reference](http://cwiki.apache.org/confluence/display/WW/Generic\+Tag\+Reference)^[http://cwiki.apache.org/confluence/display/WW/Generic\+Tag\+Reference].
+
+
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Struts 2 if Tag#####
+
+In the example application's thankyou.jsp is this markup.
+
+**thankyou.jsp Struts if Tag**
+
+
+~~~~~~~
+<s:if test="personBean.over21">
+    <p>You are old enough to vote!</p>
+</s:if>
+<s:else>
+   <p>You are NOT old enough to vote.</p>
+</s:else>
+
+~~~~~~~
+
+The Struts if tag has a test attribute. The value of the test attribute must evaluate to true or false. If true the statements between the opening and closing s:if tags will be executed. If false, the statements between the opening and closing s:else tags will be executed. Note that s:else tags come after the closing s:if tag and that the s:else tags are not required.
+
+In the above example the Struts framework will call method getPersonBean exposed by the Action class (EditAction.java). Using the Person object returned by that method, the framework will then call method isOver21 of class Person. That method returns a boolean that will be used to determine if the test is true or false.
+
+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.
+
+
+~~~~~~~
+<s:if test="personBean.carModels.length > 1">
+	<p>Car models
+</s:if>
+<s:else>
+   <p>Car model
+</s:else>
+
+~~~~~~~
+
+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".
+
+#####Struts iterator Tag#####
+
+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.
+
+
+~~~~~~~
+<table style="margin-left:15px">
+	<s:iterator value="personBean.carModels">
+		<tr><td><s:property /></td></tr>
+	</s:iterator>
+</table>
+
+~~~~~~~
+
+The goal of this code is to create an HTML table with a row that display a car model selected by the user on the edit page. The car models the user selects on the edit page are stored in the carModels field (a String array) of the personBean object (of class Person).
+
+The iterator tag has a value attribute that must evaluate to a collection (Array, List, Map).
+
+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.
+
+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:
+
+
+~~~~~~~
+<table style="margin-left:15px">
+	<s:iterator value="states" >	
+		<tr><td><s:property value="stateAbbr" /></td> <td><s:property value="stateName" /></tr>
+	</s:iterator>
+</table>
+
+~~~~~~~
+
+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.
+
+#####Additional Iterator Attributes#####
+
+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 [iterator tag reference](https://cwiki.apache.org/confluence/display/WW/iterator)^[https://cwiki.apache.org/confluence/display/WW/iterator] for more information.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/debugging-struts.md
----------------------------------------------------------------------
diff --git a/source/getting-started/debugging-struts.md b/source/getting-started/debugging-struts.md
new file mode 100644
index 0000000..df3d03f
--- /dev/null
+++ b/source/getting-started/debugging-struts.md
@@ -0,0 +1,70 @@
+---
+layout: default
+title: Debugging Struts
+---
+## Debugging Struts
+
+The example code for this tutorial, debugging_struts, is available for checkout at [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+__Introduction__
+
+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.
+
+
+
+| The Struts 2 [user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+__Configuration Plugin__
+
+The Struts 2 config browser plugin provides details about the configuration the Struts 2 framework is using to run your application. To use the plugin your application needs to have the struts2-config-browser-plugin-x.x.x.x.jar in your application's class path. The config-browser-plugin jar is part of the Struts 2 download and is also available in the Maven repository.
+
+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).
+
+
+~~~~~~~
+<a href="<s:url action="index" namespace="config-browser" />">Launch the configuration browser</a>
+
+~~~~~~~
+
+In the example application, there is a link to the configuration browser on the index.jsp page.
+
+Clicking on the link for the configuration browser will cause the Struts 2 framework to return this page to your browser.
+
+![debuging-struts-1.png](attachments/att17137672_debuging-struts-1.png)
+
+You can click on an action link to see the configuration for that action. For example clicking on the register action link results in this.
+
+![debuging-struts-2.png](attachments/att17137673_debuging-struts-2.png)
+
+You may then click on one of the tabs (Results, Exception Mappings, Interceptors, Properties, Validators) to get more information about how the Struts 2 framework is has configured that specific action.
+
+On the left side of the page is the config browser plugin menu. Clicking on constants will render a view that lists all the Struts 2 constants and their properties for your application. Clicking on beans shows the beans Struts 2 is managing. Clicking on Jars shows the jars your application is using.
+
+__Using the Debugging Interceptor__
+
+If you have set 
+
+~~~~~~~
+devMode
+~~~~~~~
+ 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.
+
+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 _DebuggingInterceptor_  for more detail.
+
+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.
+
+![debuging-struts-3.png](attachments/att17137674_debuging-struts-3.png)
+
+Note that to enable the correct display and interaction of the expand/collapse links on the debugging information web page you need to include the s:head tag in your JSP's head section (see index.jsp in the example application) and also include the Struts 2 dojo plugin in your application's class path. The Struts 2 dojo plugin is available as part of the Struts 2 download and from the Maven repository.
+
+__Struts 2 Logging__
+
+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 _Logging_  page for other options.
+
+__Summary__
+
+Using the configuration browser plugin and the debugging interceptor can assist you in trouble shooting a problem with a Struts 2 web application. These tools should only be used in development.
+
+Prior to creating your war file for deployment to production you should change devmode to false and remove the debugging links. You may also want to adjust the level of logging in your log properties file to a higher level (info or warn) to reduce the number of log messages.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/exception-handling.md
----------------------------------------------------------------------
diff --git a/source/getting-started/exception-handling.md b/source/getting-started/exception-handling.md
new file mode 100644
index 0000000..8951ac5
--- /dev/null
+++ b/source/getting-started/exception-handling.md
@@ -0,0 +1,118 @@
+---
+layout: default
+title: Exception handling
+---
+## Exception Handling
+
+The code for this tutorial, exception_handling, is available for checkout at [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+> 
+
+#####Introduction#####
+
+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.
+
+
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Global Exception Handling#####
+
+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.
+
+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.
+
+
+~~~~~~~
+  
+   <global-results>
+        <result name="securityerror">/securityerror.jsp</result>
+  	<result name="error">/error.jsp</result>
+   </global-results>
+
+   <global-exception-mappings>
+	<exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" result="securityerror" />
+	 <exception-mapping exception="java.lang.Exception" result="error" />
+   </global-exception-mappings>
+  
+
+~~~~~~~
+
+The global exception mapping node tells the Struts 2 framework what to do if an uncaught exception of the type specified (or a child of that type) is thrown by the the application. For example if a SecurityBreachException is thrown but not caught, the Struts 2 Action class will return a result of "securityerror". All other uncaught exceptions will cause the Struts 2 Action class to return a result of "error".
+
+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.
+
+#####Exception Handling Per Action#####
+
+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.
+
+
+~~~~~~~
+   <action name="actionspecificexception" class="org.apache.struts.register.action.Register" method="throwSecurityException">
+     <exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" 
+          result="login" />
+      <result>/register.jsp</result>
+      <result name="login">/login.jsp</result>
+   </action>
+
+
+~~~~~~~
+
+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.
+
+You can see that an action-specific exception mapping will take precedence if the same exception is also mapped globally.
+
+#####Logging Exceptions#####
+
+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 [ExceptionMappingInterceptor class API](http://struts.apache.org/release/2.3.x/xwork-core/apidocs/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptor.html)^[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.
+
+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.
+
+
+~~~~~~~
+<interceptors>
+  <interceptor-stack name="appDefaultStack">
+    <interceptor-ref name="defaultStack">
+     <param name="exception.logEnabled">true</param>
+     <param name="exception.logLevel">ERROR</param>
+    </interceptor-ref>
+ </interceptor-stack>
+</interceptors>
+
+<default-interceptor-ref name="appDefaultStack" />
+
+
+~~~~~~~
+
+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).
+
+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.
+
+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.
+
+In the example applications, the logging is just to the Servlet container's console (see the log4j.xml file for the log settings).
+
+#####Display Exception Information In Browser#####
+
+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.
+
+
+~~~~~~~
+   <h4>The application has malfunctioned.</h4>
+
+   <p>  Please contact technical support with the following information:</p> 
+
+   <h4>Exception Name: <s:property value="exception" /> </h4>
+
+   <h4>Exception Details: <s:property value="exceptionStack" /></h4> 
+
+
+~~~~~~~
+
+When the exception interceptor is triggered it adds to the fields available for display the exception message and the exception's stack trace.
+
+#####Summary#####
+
+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.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/exclude-parameters.md
----------------------------------------------------------------------
diff --git a/source/getting-started/exclude-parameters.md b/source/getting-started/exclude-parameters.md
new file mode 100644
index 0000000..ae93530
--- /dev/null
+++ b/source/getting-started/exclude-parameters.md
@@ -0,0 +1,102 @@
+---
+layout: default
+title: Exclude parameters
+---
+## Exclude Parameters
+
+The example code for this tutorial, exclude_parameters, is available at [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+#####Introduction#####
+
+When [Struts development mode is set to true](http://struts.apache.org/2.3.8/docs/strutsproperties.html)^[http://struts.apache.org/2.3.8/docs/strutsproperties.html] (also see [Debugging Struts](#PAGE_16941310)) the framework writes many informative messages to the log file. These messages include ones that indicate whether or not a specific parameter will be handled by the parameter interceptor and made available to the Action class. These log messages can be helpful in clearly identifying parameters that you do not want the parameter interceptor to process for security or other reasons. This article discusses how to exclude parameters from being handled by the parameter interceptor.
+
+
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Processing Request Parameters#####
+
+Most request parameters are by default processed by the parameter interceptor and Struts 2 will attempt to modify the state of those Action class fields that match up to a parameter name by calling a corresponding public set method. For example if the request includes a parameter of lastName with a value of Phillips, Struts 2 will try to call a public method with a signature of setLastName(String lastName). However, there may be request parameters that you do not want Struts 2 to try to set the value of in the Action class.
+
+Consider this code which creates a form:
+
+**Struts 2 Form Tags**
+
+
+~~~~~~~
+<s:form action="save" method="post">
+<s:textfield key="personBean.firstName" /> 
+<s:textfield key="personBean.lastName" /> 
+<s:textfield key="personBean.email" />
+<s:textfield key="personBean.phoneNumber" />
+<s:select key="personBean.sport" list="sports" />
+<s:radio key="personBean.gender" list="genders" />
+<s:select key="personBean.residency" list="states" listKey="stateAbbr" listValue="stateName" />
+<s:checkbox key="personBean.over21" />
+<s:checkboxlist key="personBean.carModels" list="carModelsAvailable" />
+<s:submit key="submit" />
+</s:form>
+
+
+~~~~~~~
+
+The s:submit tag will create a submit button with a name of submit. Since the Action class probably doesn't have a setSubmit(String name) method you will see the following log messages (only if Struts development mode is set to true):
+
+**Log Messages**
+
+
+~~~~~~~
+Dec 31, 2012 3:43:53 PM 
+com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
+WARNING: Parameter [submit] is not on the excludeParams list of patterns and will be appended to action!
+
+Dec 31, 2012 3:43:53 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
+SEVERE: Developer Notification (set struts.devMode to false to disable this message):
+Unexpected Exception caught setting 'submit' on 'class org.apache.struts.edit.action.EditAction: Error setting expression 'submit' with value ['Save Changes', ]
+
+
+~~~~~~~
+
+#####Excluding Request Parameters From Struts 2 Processing#####
+
+
+If you're not familiar with setting up a custom interceptor stack for your Struts 2 application review [Introducing Interceptors](#PAGE_24187261).
+
+| 
+
+To exclude specific parameters from being processed by the Struts 2 framework you need to add those parameter names to the list of excluded parameters. One way to do this is by adding those parameter names to the collection of excludedParams for the Parameters interceptor. You can do this by modifying the Parameters interceptor in setting up the stack of interceptors used by your Struts 2 application. For example:
+
+**Setup Interceptor Stack To Exclude submit Parameter**
+
+
+~~~~~~~
+<interceptors>
+  <interceptor-stack name="appDefault">
+    <interceptor-ref name="defaultStack">
+       <param name="exception.logEnabled">true</param>
+       <param name="exception.logLevel">ERROR</param>
+       <param name="params.excludeParams">dojo..*,^struts..*,^session..*,^request..*,^application..*,^servlet(Request|Response)..*,parameters...*,submit</param>
+    </interceptor-ref>
+  </interceptor-stack>
+</interceptors>
+		
+<default-interceptor-ref name="appDefault" />
+
+
+~~~~~~~
+
+The value of node \<param name="params.excludeParams"\> is a comma-delimited list of regular expressions or simple Strings that identify request parameters that should NOT be processed by the Parameters interceptor. To exclude the submit parameter (which is the name of the submit button in the form code above), I just added submit to the list.
+
+See the [Basic Stack of Interceptors described here](http://struts.apache.org/2.3.8/docs/struts-defaultxml.html)^[http://struts.apache.org/2.3.8/docs/struts-defaultxml.html] to view the initial set of parameter names/regular expressions to exclude. Be sure to copy over the list of parameters already being excluded and then add your own parameters to the end separated by commas.
+
+#####Example Application#####
+
+Download the example application, [Exclude_Params_Struts2_Mvn](http://code.google.com/p/struts2-examples/downloads/list)^[http://code.google.com/p/struts2-examples/downloads/list] that demonstrates excluding a request parameter. The download is a zipped Maven project. You should be able to unzip it and import the project into any Maven-aware Java IDE. See the project's README.txt file for how to build and run the application.
+
+To see the log messages written when not excluding the submit parameter remove the ",submit" from the list of excluded parameter values in the struts.xml file. Then rebuild and redeploy the application and view the console when running the application.
+
+#####Summary#####
+
+It's a nice feature of the Struts 2 framework that it logs during development which request parameters will and will not be processed. During development of a Struts 2 web application it's a good practice to review these log messages to determine if there are any parameters that the framework should not process. For those parameters the Struts 2 framework should not process add the parameter name (or a regular expression that can be used to identify multiple parameter names) to the comma-delimited list that is the value for the \<param name="params.excludeParams"\> node.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/39272be0/source/getting-started/form-tags.md
----------------------------------------------------------------------
diff --git a/source/getting-started/form-tags.md b/source/getting-started/form-tags.md
new file mode 100644
index 0000000..fd36cc4
--- /dev/null
+++ b/source/getting-started/form-tags.md
@@ -0,0 +1,239 @@
+---
+layout: default
+title: Form tags
+---
+## Form Tags
+
+The example code for this tutorial, form_tags, can be checked out from [https://github.com/apache/struts-examples](https://github.com/apache/struts-examples).
+
+> 
+
+#####Introduction#####
+
+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 (_Processing Forms_ , _Form Validation_ , and _Message Resource Files_ ) 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.
+
+
+
+| The [Struts 2 user mailing list](http://struts.apache.org/mail.html)^[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.
+
+| 
+
+#####Example Application#####
+
+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.
+
+To enable the user to edit his information that is stored in the Person object, we need to create a form like this one:
+
+![Screen shot 2010-04-25 at 8.39.59 AM.png](attachments/att19660802_Screen shot 2010-04-25 at 8.39.59 AM.png)
+
+The form allows the user to make changes. After submitting the form, the Struts 2 framework will update the state of the Person object.
+
+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.
+
+#####Struts 2 Select Tag#####
+
+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.
+
+**Struts 2 Select Tag**
+
+
+~~~~~~~
+<s:select key="personBean.sport" list="sports" />
+
+
+~~~~~~~
+
+In these form tags, we are using the key attribute as discussed in the _Message Resource Files_  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 _Message Resource Files_  tutorial for information on using Struts 2 property files).
+
+
+> 
+
+> 
+
+> 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.
+
+> 
+
+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.
+
+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".
+
+Here is the HTML that results from using the above Struts 2 select tag.
+
+**HTML Created By Struts 2 Select Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_sport" class="label">Favorite sport:</label>
+</td>
+<td>
+<select name="personBean.sport" id="save_personBean_sport">
+    <option value="football">football</option>
+    <option value="baseball">baseball</option>
+    <option value="basketball" selected="selected">basketball</option>
+</select>
+</td>
+</tr>
+
+
+~~~~~~~
+
+Note the table formatting created by the Struts 2 framework when using the Struts 2 select tag. The CSS classes are defined in style sheets included by the Struts 2 s:head tag. The Struts 2 s:head tag is placed inside the edit.jsp's head section.
+
+Since the personBean's getSport method returns "baskeball", the basketball option value is marked as selected.
+
+#####Struts 2 Radio Tag#####
+
+The Struts 2 radio tag\u2014like its standard HTML counterpart\u2014is 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.
+
+**Struts 2 Radio Tag**
+
+
+~~~~~~~
+<s:radio key="personBean.gender" list="genders" />
+
+
+~~~~~~~
+
+Again the key attribute's value determines the value for the label and value attributes. The label's text is derived from the EditAction.properties file (key personBean.gender). Just like the Struts 2 select tag, the list attribute of the Struts 2 radio tag causes the framework to call the getGenders method of the EditAction class. The Array of String objects returned are used to create the individual radio buttons.
+
+**HTML Created By Struts 2 Radio Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_gender" class="label">Gender:</label></td>
+<td>
+<input type="radio" name="personBean.gender" id="save_personBean_gendermale" value="male"/><label for="save_personBean_gendermale">male</label>
+<input type="radio" name="personBean.gender" id="save_personBean_genderfemale" value="female"/><label for="save_personBean_genderfemale">female</label>
+<input type="radio" name="personBean.gender" id="save_personBean_gendernot sure" checked="checked" value="not sure"/><label for="save_personBean_gendernot sure">not sure</label>
+</td>
+</tr>
+
+
+~~~~~~~
+
+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.
+
+#####Struts 2 Select Tag - Object Backed#####
+
+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
+
+**Struts 2 Select Tag Object Backed**
+
+
+~~~~~~~
+<s:select key="personBean.residency" list="states" listKey="stateAbbr" listValue="stateName" />
+
+
+~~~~~~~
+
+The list value tells the framework to call the getStates method of the EditAction class. That method returns an ArrayList of State objects. Each State object has getStateAbbr and getStateName methods.
+
+The listKey attribute tells the framework to use the value returned by calling the getStateAbbr method as the value for the value attribute of the HTML option tag and the value returned by calling the getStateName method as the value displayed to the user. So the above Struts 2 select tag code results in this HTML.
+
+**HTML Created By Struts 2 Select Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_residency" class="label">State resident:</label></td>
+<td>
+<select name="personBean.residency" id="save_personBean_residency">
+    <option value="AZ">Arizona</option>
+    <option value="CA">California</option>
+    <option value="FL">Florida</option>
+    <option value="KS" selected="selected">Kansas</option>
+    <option value="NY">New York</option>
+</select>
+</td>
+</tr>
+
+
+~~~~~~~
+
+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.
+
+#####Struts 2 Checkbox Tag#####
+
+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.
+
+**Struts 2 Checkbox Tag**
+
+
+~~~~~~~
+<s:checkbox key="personBean.over21" />
+
+
+~~~~~~~
+
+Since the method getOver21 returns true, the checkbox is checked.
+
+**HTML Created By Struts 2 Checkbox Tag**
+
+
+~~~~~~~
+<tr>
+<td valign="top" align="right">
+</td>
+<td valign="top" align="left">
+<input type="checkbox" name="personBean.over21" value="true" checked="checked" id="save_personBean_over21"/>
+<input type="hidden" id="__checkbox_save_personBean_over21" name="__checkbox_personBean.over21" value="true" />  <label for="save_personBean_over21" class="checkboxLabel">21 or older</label>
+</td>
+</tr>
+
+
+~~~~~~~
+
+When the form is submitted and the checkbox is not checked, no value will be posted for the checkbox (this is how HTML forms work). Since the Struts 2 framework will need to update the value of the personBean's over21 instance field to false\u2014given that the check box was not checked\u2014the framework needs a way to determine if the checkbox was not checked after form submission.
+
+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.
+
+#####Struts 2 checkboxlist Tag#####
+
+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.
+
+Using the Struts 2 checkbox tag, we can create a series of checkboxes, one for each possible car model the user may own. The value of each String in the personBean's carModels Array will determine which checkboxes are checked.
+
+**Struts 2 Checkboxlist Tag**
+
+
+~~~~~~~
+<s:checkboxlist key="personBean.carModels" list="carModelsAvailable" />
+
+
+~~~~~~~
+
+The list attributes value in the checkboxlist tag tells the Struts 2 framework which method to call to get the possible car models. In the example application, the framework will call the EditAction class's getCarModelsAvailable method. That method returns an Array of Strings. For each element of the Array, the Struts 2 framework creates a checkbox (including the associated hidden field described above).
+
+The key attribute value in the checkboxlist tag tells the Struts 2 framework which method to call on the personBean object to determine which checkboxes should be checked. In the example application, the framework will call the personBean object's getCarModels method. The getCarModels method returns an Array of Strings. For each String value in that Array that matches a String value in the Array returned by the EditAction class's getCarModelsAvailable, the checkbox will be checked.
+
+**HTML Created By Struts 2 Checkboxlist Tag**
+
+
+~~~~~~~
+<tr>
+<td class="tdLabel">
+<label for="save_personBean_carModels" class="label">Car models owned:</label></td>
+<td>
+<input type="checkbox" name="personBean.carModels" value="Ford" id="personBean.carModels-1" checked="checked"/>
+<label for="personBean.carModels-1" class="checkboxLabel">Ford</label>
+<input type="checkbox" name="personBean.carModels" value="Chrysler" id="personBean.carModels-2"/>
+<label for="personBean.carModels-2" class="checkboxLabel">Chrysler</label>
+<input type="checkbox" name="personBean.carModels" value="Toyota" id="personBean.carModels-3"/>
+<label for="personBean.carModels-3" class="checkboxLabel">Toyota</label>
+<input type="checkbox" name="personBean.carModels" value="Nissan" id="personBean.carModels-4" checked="checked"/>
+<label for="personBean.carModels-4" class="checkboxLabel">Nissan</label>
+<input type="hidden" id="__multiselect_save_personBean_carModels" name="__multiselect_personBean.carModels" value="" />
+</td>
+</tr>
+
+
+~~~~~~~
+
+Summary
+ There are several other Struts 2 form controls you should explore. If you need more information about the Struts 2 form tags consult the Struts 2 documentation at [http://struts.apache.org](http://struts.apache.org).