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

[2/5] struts-site git commit: Uses dedicated layout

Uses dedicated layout


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

Branch: refs/heads/master
Commit: aaa64647857cf0f4c0e7e9515506c18a462d90cf
Parents: ccdbffb
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Wed Apr 12 10:17:53 2017 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Wed Apr 12 10:17:53 2017 +0200

----------------------------------------------------------------------
 source/_layouts/getting-started.html            |  50 ++++++++
 source/getting-started/annotations.md           |   6 +-
 source/getting-started/coding-actions.md        |  24 ++--
 source/getting-started/control-tags.md          |   4 +-
 source/getting-started/debugging-struts.md      |   2 +-
 source/getting-started/exception-handling.md    |  38 +++---
 source/getting-started/exclude-parameters.md    |   2 +-
 source/getting-started/form-tags.md             | 118 +++++++++----------
 .../form-validation-using-xml.md                |   2 +-
 source/getting-started/form-validation.md       |  28 ++---
 .../hello-world-using-struts2.md                |  18 +--
 .../how-to-create-a-struts2-web-application.md  |   2 +-
 source/getting-started/http-session.md          |  45 +++----
 .../getting-started/introducing-interceptors.md |   2 +-
 .../getting-started/message-resource-files.md   |  22 ++--
 source/getting-started/preperable-interface.md  |   8 +-
 source/getting-started/processing-forms.md      |   2 +-
 source/getting-started/spring.md                |   4 +-
 source/getting-started/themes.md                |  22 ++--
 source/getting-started/unit-testing.md          |  36 +++---
 source/getting-started/using-tags.md            |   2 +-
 .../wildcard-method-selection.md                |   2 +-
 22 files changed, 244 insertions(+), 195 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/_layouts/getting-started.html
----------------------------------------------------------------------
diff --git a/source/_layouts/getting-started.html b/source/_layouts/getting-started.html
new file mode 100644
index 0000000..dd1e9e9
--- /dev/null
+++ b/source/_layouts/getting-started.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8"/>
+  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+  <meta name="Date-Revision-yyyymmdd" content="20140918"/>
+  <meta http-equiv="Content-Language" content="en"/>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+
+  <title>{{ page.title }}</title>
+
+  <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css">
+  <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
+  <link href="/css/main.css" rel="stylesheet">
+  <link href="/css/custom.css" rel="stylesheet">
+  <link href="/highlighter/github-theme.css" rel="stylesheet">
+
+  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
+  <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script>
+  <script type="text/javascript" src="/js/community.js"></script>
+</head>
+<body>
+
+{% include header.html %}
+
+<article class="container">
+  <section class="col-md-12">
+    <a href="index.html" title="back to Getting Started"><< back to Getting Started</a>
+    {{ content }}
+  </section>
+</article>
+
+{% include footer.html %}
+
+<script>
+$(function() {
+  return $("h2, h3, h4, h5, h6").each(function(i, el) {
+    var $el, id;
+    $el = $(el);
+    id = $el.attr('id');
+    if (id) {
+      $el.removeAttr('id');
+      return $el.before($("<a />").addClass('anchor').attr('name', id));
+    }
+  });
+});
+</script>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/annotations.md
----------------------------------------------------------------------
diff --git a/source/getting-started/annotations.md b/source/getting-started/annotations.md
index 2ba1234..daf2b59 100644
--- a/source/getting-started/annotations.md
+++ b/source/getting-started/annotations.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Annotations
 ---
 ## Annotations
@@ -24,7 +24,7 @@ Struts 2 enables the use of standard naming conventions and annotations when you
 <dependency>
     <groupId>org.apache.struts</groupId>
     <artifactId>struts2-convention-plugin</artifactId>
-    <version>2.5.10.1</version>
+    <version>X.X.X.X</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.
@@ -93,4 +93,4 @@ __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](//struts.apache.org/docs/convention-plugin.html) documentation for alternative ways to configure your Struts 2 application.
 
-|Return to [Spring and Struts 2](spring.html)|or|onward to [Introducing Interceptors](introducing-interceptors.html)|
\ No newline at end of file
+|Return to [Spring and Struts 2](spring.html)|or|onward to [Introducing Interceptors](introducing-interceptors.html)|

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/coding-actions.md
----------------------------------------------------------------------
diff --git a/source/getting-started/coding-actions.md b/source/getting-started/coding-actions.md
index a277d39..5b0fddc 100644
--- a/source/getting-started/coding-actions.md
+++ b/source/getting-started/coding-actions.md
@@ -1,13 +1,11 @@
 ---
-layout: default
+layout: getting-started
 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:
@@ -77,15 +75,15 @@ For the example application associated with this tutorial add the following Java
 **Add userName to HelloWorldAction**
 
 ```java
-    private String userName;
+private String userName;
 
-    public String getUserName() {
-        return userName;
-    }
+public String getUserName() {
+    return userName;
+}
 
-    public void setUserName(String userName) {
-        this.userName = 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.
@@ -93,9 +91,9 @@ To personalize the MessageStore message (recall that class MessageStore is stori
 **Add userName value to message**
 
 ```java
-    if (userName != null) {
-        messageStore.setMessage( messageStore.getMessage() + " " + userName);
-    }
+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.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/control-tags.md
----------------------------------------------------------------------
diff --git a/source/getting-started/control-tags.md b/source/getting-started/control-tags.md
index d7fcb3a..b8208f6 100644
--- a/source/getting-started/control-tags.md
+++ b/source/getting-started/control-tags.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Control tags
 ---
 ## Control Tags
@@ -78,4 +78,4 @@ __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) for more information.
 
-|Return to [Form validation using XML](form-validation-using-xml.md)|or|onward to [Wildcard method selection](wildcard-method-selection.html)|
\ No newline at end of file
+|Return to [Form validation using XML](form-validation-using-xml.md)|or|onward to [Wildcard method selection](wildcard-method-selection.html)|

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/debugging-struts.md
----------------------------------------------------------------------
diff --git a/source/getting-started/debugging-struts.md b/source/getting-started/debugging-struts.md
index e28854a..6cfe0a4 100644
--- a/source/getting-started/debugging-struts.md
+++ b/source/getting-started/debugging-struts.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Debugging Struts
 ---
 ## Debugging Struts

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/exception-handling.md
----------------------------------------------------------------------
diff --git a/source/getting-started/exception-handling.md b/source/getting-started/exception-handling.md
index ac34450..0f8c66b 100644
--- a/source/getting-started/exception-handling.md
+++ b/source/getting-started/exception-handling.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Exception handling
 ---
 ## Exception Handling
@@ -19,15 +19,15 @@ Using the Struts 2 framework you can specify in the struts.xml how the framework
 To enable global exception handling you need to add two nodes to `struts.xml`: `global-exception-mapping` and `global-results`. For example examine the `struts.xml` from the exception_handling project.
 
 ```xml
-    <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>
+<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".
@@ -39,11 +39,11 @@ __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.
 
 ```xml
-   <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>
+<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 the 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.
@@ -82,13 +82,13 @@ __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.
 
 ```html
-   <h4>The application has malfunctioned.</h4>
+<h4>The application has malfunctioned.</h4>
 
-   <p>  Please contact technical support with the following information:</p> 
+<p>Please contact technical support with the following information:</p> 
 
-   <h4>Exception Name: <s:property value="exception" /> </h4>
+<h4>Exception Name: <s:property value="exception" /> </h4>
 
-   <h4>Exception Details: <s:property value="exceptionStack" /></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.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/exclude-parameters.md
----------------------------------------------------------------------
diff --git a/source/getting-started/exclude-parameters.md b/source/getting-started/exclude-parameters.md
index 4d23bcb..0138296 100644
--- a/source/getting-started/exclude-parameters.md
+++ b/source/getting-started/exclude-parameters.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Exclude parameters
 ---
 ## Exclude Parameters

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/form-tags.md
----------------------------------------------------------------------
diff --git a/source/getting-started/form-tags.md b/source/getting-started/form-tags.md
index f64f56b..6796451 100644
--- a/source/getting-started/form-tags.md
+++ b/source/getting-started/form-tags.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Form tags
 ---
 ## Form Tags
@@ -72,16 +72,16 @@ Here is the HTML that results from using the above Struts 2 select tag.
 
 ```html
 <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>
+    <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>
 ```
 
@@ -111,19 +111,19 @@ The Array of String objects returned are used to create the individual radio but
 
 ```html
 <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>
+    <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>
 ```
 
@@ -154,18 +154,18 @@ displayed to the user. So the above Struts 2 select tag code results in this HTM
 
 ```html
 <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>
+    <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>
 ```
 
@@ -192,12 +192,12 @@ Since the method getOver21 returns true, the checkbox is checked.
 
 ```html
 <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>
+    <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>
 ```
 
@@ -242,23 +242,23 @@ the checkbox will be checked.
 
 ```html
 <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>
+    <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>
 ```
 

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/form-validation-using-xml.md
----------------------------------------------------------------------
diff --git a/source/getting-started/form-validation-using-xml.md b/source/getting-started/form-validation-using-xml.md
index 8204a89..64f2130 100644
--- a/source/getting-started/form-validation-using-xml.md
+++ b/source/getting-started/form-validation-using-xml.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Form validation using XML
 ---
 ## Form Validation Using XML

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/form-validation.md
----------------------------------------------------------------------
diff --git a/source/getting-started/form-validation.md b/source/getting-started/form-validation.md
index bdcbbb3..04615e7 100644
--- a/source/getting-started/form-validation.md
+++ b/source/getting-started/form-validation.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Form Validation
 ---
 ## Form Validation
@@ -31,19 +31,19 @@ Add the following validate method to Register.java (the Action class).
 **validate method**
 
 ```java
-    public void validate(){
-        if (personBean.getFirstName().length() == 0) {
-            addFieldError("personBean.firstName", "First name is required.");
-        }
-
-        if (personBean.getEmail().length() == 0) {
-            addFieldError("personBean.email", "Email is required.");
-        }
-
-        if (personBean.getAge() < 18) {
-            addFieldError("personBean.age", "Age is required and must be 18 or older");
-        }
+public void validate(){
+    if (personBean.getFirstName().length() == 0) {
+        addFieldError("personBean.firstName", "First name is required.");
     }
+
+    if (personBean.getEmail().length() == 0) {
+        addFieldError("personBean.email", "Email is required.");
+    }
+
+    if (personBean.getAge() < 18) {
+        addFieldError("personBean.age", "Age is required and must be 18 or older");
+    }
+}
 ```
 
 When the user presses the submit button on the register form, Struts 2 will transfer the user's input to the personBean's instance fields. Then Struts 2 will automatically execute the validate method. If any of the if statements are true, Struts 2 will call its addFieldError method (which our Action class inherited by extending ActionSupport).
@@ -69,7 +69,7 @@ So when validation fails and Struts 2 returns input, the Struts 2 framework will
 So the following addFieldError method call:
 
 ```java
-    addFieldError("personBean.firstName", "First name is required.")
+addFieldError("personBean.firstName", "First name is required.")
 ```
 
 will cause the message "First name is required" to be displayed above the firstName field on the form.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/hello-world-using-struts2.md
----------------------------------------------------------------------
diff --git a/source/getting-started/hello-world-using-struts2.md b/source/getting-started/hello-world-using-struts2.md
index 04c3004..10a0cec 100644
--- a/source/getting-started/hello-world-using-struts2.md
+++ b/source/getting-started/hello-world-using-struts2.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Hello World using Struts 2
 ---
 ## Hello World Using Struts 2
@@ -173,14 +173,14 @@ First add the taglib directive at the top of the jsp `<%@ taglib prefix="s" uri=
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-    <title>Basic Struts 2 Application - Welcome</title>
-  </head>
-  <body>
-    <h1>Welcome To Struts 2!</h1>
-    <p><a href="<s:url action='hello'/>">Hello World</a></p>
-  </body>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+        <title>Basic Struts 2 Application - Welcome</title>
+    </head>
+    <body>
+        <h1>Welcome To Struts 2!</h1>
+        <p><a href="<s:url action='hello'/>">Hello World</a></p>
+    </body>
 </html>
 ```
 

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/how-to-create-a-struts2-web-application.md
----------------------------------------------------------------------
diff --git a/source/getting-started/how-to-create-a-struts2-web-application.md b/source/getting-started/how-to-create-a-struts2-web-application.md
index 7a84838..acc40c4 100644
--- a/source/getting-started/how-to-create-a-struts2-web-application.md
+++ b/source/getting-started/how-to-create-a-struts2-web-application.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: How to create a Struts 2 web application
 ---
 ## How To Create A Struts 2 Web Application

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/http-session.md
----------------------------------------------------------------------
diff --git a/source/getting-started/http-session.md b/source/getting-started/http-session.md
index 852b934..20bd341 100644
--- a/source/getting-started/http-session.md
+++ b/source/getting-started/http-session.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Http Session
 ---
 ## HTTP Session
@@ -73,15 +73,15 @@ Using SessionAware does introduce a potential security vulnerability that you sh
 **HelloWorldAction.java acceptableParameterName Method**
 
 ```java
-    public boolean acceptableParameterName(String parameterName) {
-        boolean allowedParameterName = true ;
+public boolean acceptableParameterName(String parameterName) {
+    boolean allowedParameterName = true ;
 
-        if ( parameterName.contains("session")  || parameterName.contains("request") ) {
-            allowedParameterName = false ;
-        } 
-		
-        return allowedParameterName;
-    }
+    if ( parameterName.contains("session")  || parameterName.contains("request") ) {
+        allowedParameterName = false ;
+    } 
+
+    return allowedParameterName;
+}
 ```
 
 This method will be called by the Struts 2 framework for each parameter in the request scope. By returning false if the parameter name contains "session" we are telling the Struts 2 framework to ignore that parameter. This will prevent a malicious user from trying to hack the HTTP session object.
@@ -91,19 +91,20 @@ Instead of having each action that implements SessionAware also implement the Pa
 **struts.xml configure params interceptor**
 
 ```xml
-    <package name="basicstruts2" extends="struts-default">
-        <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...*</param>
-                </interceptor-ref>
-            </interceptor-stack>
-        </interceptors>
-		
-        <default-interceptor-ref name="appDefault" />
-...
+<package name="basicstruts2" extends="struts-default">
+    <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...*</param>
+            </interceptor-ref>
+        </interceptor-stack>
+    </interceptors>
+
+    <default-interceptor-ref name="appDefault" />
+    ...
+</package>
 ```
 
 The above code will ensure that every action in the "basicstruts2" package that implements the SessionAware interface will exclude from processing parameters that starts with the strings provided in the params.excludeParams noded.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/introducing-interceptors.md
----------------------------------------------------------------------
diff --git a/source/getting-started/introducing-interceptors.md b/source/getting-started/introducing-interceptors.md
index 66cd51b..4837215 100644
--- a/source/getting-started/introducing-interceptors.md
+++ b/source/getting-started/introducing-interceptors.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Introducing Interceptors
 ---
 ## Introducing Interceptors

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/message-resource-files.md
----------------------------------------------------------------------
diff --git a/source/getting-started/message-resource-files.md b/source/getting-started/message-resource-files.md
index 60375d4..b572da3 100644
--- a/source/getting-started/message-resource-files.md
+++ b/source/getting-started/message-resource-files.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Message Resource Files
 ---
 ## Message Resource Files
@@ -78,9 +78,9 @@ We use the Struts 2 url tag to create a link to action registerInput. We then us
 **registerInput action node for struts.xml**
 
 ```xml
-    <action name="registerInput" class="org.apache.struts.register.action.Register" method="input" >
-        <result name="input">/register.jsp</result>
-    </action>
+<action name="registerInput" class="org.apache.struts.register.action.Register" method="input" >
+    <result name="input">/register.jsp</result>
+</action>
 ```
 
 The above action node instructs the Struts 2 framework to execute class Register's input method in response to action registerInput. The input method is inherited by class Register from class ActionSupport. The default behavior of the inherited input method is to return the String input. The result node above specifies that if the returned result is "input" then render the view register.jsp.
@@ -172,8 +172,8 @@ To use the contact key in a view page, add the following markup to index.jsp jus
 **Using contact property**
 
 ```html
-    <hr />
-    <s:text name="contact" />
+<hr />
+<s:text name="contact" />
 ```
 
 Rebuild the war file, deploy it to your Servlet container, and then go to index.action. You should see:
@@ -209,11 +209,11 @@ In our example application, we need to tell Struts 2 to use a locale value of es
 **Specify The Locale As a URL Parameter**
 
 ```html
-    <h3>Registro espa�ol</h3>
-    <s:url action="registerInput" var="registerInputLinkES">
-        <s:param name="request_locale">es</s:param>
-    </s:url>
-    <p><a href="${registerInputLinkES}">Por favor, reg�strese</a> para nuestro sorteo</p>
+<h3>Registro espa�ol</h3>
+<s:url action="registerInput" var="registerInputLinkES">
+    <s:param name="request_locale">es</s:param>
+</s:url>
+<p><a href="${registerInputLinkES}">Por favor, reg�strese</a> para nuestro sorteo</p>
 ```
 
 In the above markup we've added a parameter named request_locale to the URL. The value of that parameter is es. The Action class that responds to this URL (Register.java) will see that the locale is es and will look for property files with _es (for example `Register_es.properties`). It will use those property files to find the values of the property keys referenced by the view page (e.g. personBean.firstName).

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/preperable-interface.md
----------------------------------------------------------------------
diff --git a/source/getting-started/preperable-interface.md b/source/getting-started/preperable-interface.md
index 5508fcf..1a18dde 100644
--- a/source/getting-started/preperable-interface.md
+++ b/source/getting-started/preperable-interface.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Preperable Interface
 ---
 ## Preparable Interface
@@ -29,9 +29,9 @@ If you examine class EditAction in the example application (see above) you'll se
 **EditAction.java prepare Method**
 
 ```java
-   carModelsAvailable = carModelsService.getCarModels() ;
-		
-   setPersonBean(editService.getPerson());
+carModelsAvailable = carModelsService.getCarModels();
+
+setPersonBean(editService.getPerson());
 ```
 
 The above statements get the car model values used to populate the car model check boxes displayed in the form and also get the information about the Person object being edited.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/processing-forms.md
----------------------------------------------------------------------
diff --git a/source/getting-started/processing-forms.md b/source/getting-started/processing-forms.md
index 7fbbb32..27afd56 100644
--- a/source/getting-started/processing-forms.md
+++ b/source/getting-started/processing-forms.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Processing forms
 ---
 ## Processing Forms

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/spring.md
----------------------------------------------------------------------
diff --git a/source/getting-started/spring.md b/source/getting-started/spring.md
index 3fe5803..2b30f15 100644
--- a/source/getting-started/spring.md
+++ b/source/getting-started/spring.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Spring
 ---
 ## Spring and Struts 2
@@ -35,7 +35,7 @@ Spring provides a mechanism to manage dependencies by injecting them at run time
 **EditAction Class No Hard-Coded Dependency**
 
 ```java
-    private EditService editService ;
+private EditService editService;
 ```
 
 At run time the Spring framework will provide an object of a class that implements the EditService interface.

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/themes.md
----------------------------------------------------------------------
diff --git a/source/getting-started/themes.md b/source/getting-started/themes.md
index 9ce11c6..51b7a01 100644
--- a/source/getting-started/themes.md
+++ b/source/getting-started/themes.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Themes
 ---
 ## Themes
@@ -26,16 +26,16 @@ generates this HTML markup:
 
 ```html
 <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>
+    <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>
 ```
 

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/unit-testing.md
----------------------------------------------------------------------
diff --git a/source/getting-started/unit-testing.md b/source/getting-started/unit-testing.md
index d79f002..bd3c9ad 100644
--- a/source/getting-started/unit-testing.md
+++ b/source/getting-started/unit-testing.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Unit testing
 ---
 ## Unit Testing
@@ -29,10 +29,10 @@ To test the validate method we want Struts to call the Struts action that will c
 **struts.xml**
 
 ```xml
-    <action name="register" class="org.apache.struts.register.action.Register" method="execute">
-        <result name="success">/thankyou.jsp</result>
-        <result name="input">/register.jsp</result>
-    </action>
+<action name="register" class="org.apache.struts.register.action.Register" method="execute">
+    <result name="success">/thankyou.jsp</result>
+    <result name="input">/register.jsp</result>
+</action>
 ```
 
 Remember the validate method will be called automatically by the framework before calling the execute method. If validation fails the Struts framework will return "input". If there are no validation errors then the framework will call the execute method and return whatever String the execute method returns.
@@ -87,19 +87,19 @@ To test that validation should fail, I just need to have a test method that does
 ```java
 @Test
 public void testExecuteValidationFailsMissingFirstName() throws Exception() {
-  //request.setParameter("personBean.firstName", "Bruce");
-  request.setParameter("personBean.lastName", "Phillips");
-  request.setParameter("personBean.email", "bphillips@ku.edu");
-  request.setParameter("personBean.age", "19");
-
-  ActionProxy actionProxy = getActionProxy("/register.action");
-  Register action = (Register) actionProxy.getAction() ;
-
-  assertNotNull("The action is null but should not be.", action);
-
-  String result = actionProxy.execute();
-
-  assertEquals("The execute method did not return " + ActionSupport.INPUT + " but should have.", ActionSupport.INPUT, result);
+    //request.setParameter("personBean.firstName", "Bruce");
+    request.setParameter("personBean.lastName", "Phillips");
+    request.setParameter("personBean.email", "bphillips@ku.edu");
+    request.setParameter("personBean.age", "19");
+    
+    ActionProxy actionProxy = getActionProxy("/register.action");
+    Register action = (Register) actionProxy.getAction() ;
+    
+    assertNotNull("The action is null but should not be.", action);
+    
+    String result = actionProxy.execute();
+    
+    assertEquals("The execute method did not return " + ActionSupport.INPUT + " but should have.", ActionSupport.INPUT, result);
 }
 ```
 

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/using-tags.md
----------------------------------------------------------------------
diff --git a/source/getting-started/using-tags.md b/source/getting-started/using-tags.md
index 6837983..1723017 100644
--- a/source/getting-started/using-tags.md
+++ b/source/getting-started/using-tags.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Using tags
 ---
 ## Using Tags

http://git-wip-us.apache.org/repos/asf/struts-site/blob/aaa64647/source/getting-started/wildcard-method-selection.md
----------------------------------------------------------------------
diff --git a/source/getting-started/wildcard-method-selection.md b/source/getting-started/wildcard-method-selection.md
index fefbad5..bbf9227 100644
--- a/source/getting-started/wildcard-method-selection.md
+++ b/source/getting-started/wildcard-method-selection.md
@@ -1,5 +1,5 @@
 ---
-layout: default
+layout: getting-started
 title: Wildcard Method Selection
 ---
 ## Wildcard Method Selection