Merge pull request #474 from kerttup/Branch_1

WW-2411 Add a maxlength attribute to the textarea tag 
diff --git a/core/src/main/java/org/apache/struts2/components/TextArea.java b/core/src/main/java/org/apache/struts2/components/TextArea.java
index 6e280fc..0d03991 100644
--- a/core/src/main/java/org/apache/struts2/components/TextArea.java
+++ b/core/src/main/java/org/apache/struts2/components/TextArea.java
@@ -51,6 +51,8 @@
     protected String readonly;
     protected String rows;
     protected String wrap;
+    protected String maxlength;
+    protected String minlength;
 
     public TextArea(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
         super(stack, request, response);
@@ -78,6 +80,13 @@
         if (wrap != null) {
             addParameter("wrap", findString(wrap));
         }
+
+        if (maxlength != null) {
+            addParameter("maxlength", findString(maxlength));
+        }
+        if (minlength != null) {
+            addParameter("minlength", findString(minlength));
+        }
     }
 
     @StrutsTagAttribute(description="HTML cols attribute", type="Integer")
@@ -99,4 +108,14 @@
     public void setWrap(String wrap) {
         this.wrap = wrap;
     }
+
+    @StrutsTagAttribute(description="HTML maxlength attribute", type="Integer")
+    public void setMaxlength(String maxlength) {
+        this.maxlength = maxlength;
+    }
+
+    @StrutsTagAttribute(description="HTML minlength attribute", type="Integer")
+    public void setMinlength(String minlength) {
+        this.minlength = minlength;
+    }
 }
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/ui/TextareaTag.java b/core/src/main/java/org/apache/struts2/views/jsp/ui/TextareaTag.java
index 1f77f1d..0efbe01 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/ui/TextareaTag.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/ui/TextareaTag.java
@@ -37,6 +37,8 @@
     protected String readonly;
     protected String rows;
     protected String wrap;
+    protected String maxlength;
+    protected String minlength;
 
     public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
         return new TextArea(stack, req, res);
@@ -50,6 +52,8 @@
         textArea.setReadonly(readonly);
         textArea.setRows(rows);
         textArea.setWrap(wrap);
+        textArea.setMaxlength(maxlength);
+        textArea.setMinlength(minlength);
     }
 
     public void setCols(String cols) {
@@ -67,5 +71,13 @@
     public void setWrap(String wrap) {
         this.wrap = wrap;
     }
+    
+    public void setMaxlength(String maxlength) {
+        this.maxlength = maxlength;
+    }
+
+    public void setMinlength(String minlength) {
+        this.minlength = minlength;
+    }
 
 }
diff --git a/core/src/main/resources/template/simple/textarea.ftl b/core/src/main/resources/template/simple/textarea.ftl
index 22f2d9b..f08826f 100644
--- a/core/src/main/resources/template/simple/textarea.ftl
+++ b/core/src/main/resources/template/simple/textarea.ftl
@@ -52,4 +52,10 @@
 <#if parameters.nameValue??>
 <@s.property value="parameters.nameValue"/><#t/>
 </#if>
+<#if parameters.maxlength?has_content>
+ maxlength="${parameters.maxlength}"<#rt/>
+</#if>
+<#if parameters.minlength?has_content>
+ minlength="${parameters.minlength}"<#rt/>
+</#if>
 </textarea>
\ No newline at end of file
diff --git a/core/src/site/resources/tags/textarea-attributes.html b/core/src/site/resources/tags/textarea-attributes.html
index fbdf054..8a35ed8 100644
--- a/core/src/site/resources/tags/textarea-attributes.html
+++ b/core/src/site/resources/tags/textarea-attributes.html
@@ -134,6 +134,14 @@
             <td align="left" valign="top">Define label position of form element (top/left)</td>
         </tr>
         <tr>
+            <td align="left" valign="top">maxlength</td>
+            <td align="left" valign="top">false</td>
+            <td align="left" valign="top"></td>
+            <td align="left" valign="top">false</td>
+            <td align="left" valign="top">Integer</td>
+            <td align="left" valign="top">HTML maxlength attribute</td>
+        </tr>
+        <tr>
             <td align="left" valign="top">name</td>
             <td align="left" valign="top">false</td>
             <td align="left" valign="top"></td>