You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by he...@apache.org on 2006/05/01 17:25:40 UTC

svn commit: r398620 - in /incubator/webwork2/action/src/main: java/org/apache/struts/action2/components/Form.java java/org/apache/struts/action2/views/jsp/ui/FormTag.java resources/META-INF/taglib.tld resources/template/simple/form.ftl

Author: hermanns
Date: Mon May  1 08:25:40 2006
New Revision: 398620

URL: http://svn.apache.org/viewcvs?rev=398620&view=rev
Log:
Form Tag needs accept-charset attribute
o added new attribute to Form, FormTag and form.ftl
o updated taglib.tld
o fixed dest dir property for ant xdoclet-taglib target
Issue Number: WW-1303

Modified:
    incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/Form.java
    incubator/webwork2/action/src/main/java/org/apache/struts/action2/views/jsp/ui/FormTag.java
    incubator/webwork2/action/src/main/resources/META-INF/taglib.tld
    incubator/webwork2/action/src/main/resources/template/simple/form.ftl

Modified: incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/Form.java
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/Form.java?rev=398620&r1=398619&r2=398620&view=diff
==============================================================================
--- incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/Form.java (original)
+++ incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/Form.java Mon May  1 08:25:40 2006
@@ -80,6 +80,7 @@
     protected String validate;
     protected String portletMode;
     protected String windowState;
+    protected String acceptcharset;
 
     public Form(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) {
         super(stack, request, response);
@@ -142,6 +143,10 @@
             addParameter("validate", findValue(validate, Boolean.class));
         }
 
+        if (acceptcharset != null) {
+            addParameter("acceptcharset", findString(acceptcharset));
+        }
+
         // keep a collection of the tag names for anything special the templates might want to do (such as pure client
         // side validation)
         if (!parameters.containsKey("tagNames")) {
@@ -368,5 +373,13 @@
      */
     public void setWindowState(String windowState) {
         this.windowState = windowState;
+    }
+
+    /**
+     * The accepted charsets for this form. The values may be comma or blank delimited.
+     * @a2.tagattribute required="false"
+     */
+    public void setAcceptcharset(String acceptcharset) {
+        this.acceptcharset = acceptcharset;
     }
 }

Modified: incubator/webwork2/action/src/main/java/org/apache/struts/action2/views/jsp/ui/FormTag.java
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/java/org/apache/struts/action2/views/jsp/ui/FormTag.java?rev=398620&r1=398619&r2=398620&view=diff
==============================================================================
--- incubator/webwork2/action/src/main/java/org/apache/struts/action2/views/jsp/ui/FormTag.java (original)
+++ incubator/webwork2/action/src/main/java/org/apache/struts/action2/views/jsp/ui/FormTag.java Mon May  1 08:25:40 2006
@@ -41,6 +41,7 @@
     protected String onsubmit;
     protected String portletMode;
     protected String windowState;
+    protected String acceptcharset;
 
     public Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
         return new Form(stack, req, res);
@@ -58,6 +59,7 @@
         form.setOnsubmit(onsubmit);
         form.setPortletMode(portletMode);
         form.setWindowState(windowState);
+        form.setAcceptcharset(acceptcharset);
     }
 
 
@@ -95,5 +97,9 @@
 
     public void setWindowState(String windowState) {
         this.windowState = windowState;
+    }
+
+    public void setAcceptcharset(String acceptcharset) {
+        this.acceptcharset = acceptcharset;
     }
 }

Modified: incubator/webwork2/action/src/main/resources/META-INF/taglib.tld
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/META-INF/taglib.tld?rev=398620&r1=398619&r2=398620&view=diff
==============================================================================
--- incubator/webwork2/action/src/main/resources/META-INF/taglib.tld (original)
+++ incubator/webwork2/action/src/main/resources/META-INF/taglib.tld Mon May  1 08:25:40 2006
@@ -461,6 +461,14 @@
 
       </attribute>
       <attribute>
+         <name>acceptcharset</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The accepted charsets for this form. The values may be comma or blank delimited.]]></description>
+
+      </attribute>
+      <attribute>
          <name>openTemplate</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>

Modified: incubator/webwork2/action/src/main/resources/template/simple/form.ftl
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/resources/template/simple/form.ftl?rev=398620&r1=398619&r2=398620&view=diff
==============================================================================
--- incubator/webwork2/action/src/main/resources/template/simple/form.ftl (original)
+++ incubator/webwork2/action/src/main/resources/template/simple/form.ftl Mon May  1 08:25:40 2006
@@ -39,4 +39,7 @@
 <#if parameters.title?exists>
  title="${parameters.title?html}"<#rt/>
 </#if>
+<#if parameters.acceptcharset?exists>
+ accept-charset="${parameters.acceptcharset?html}"<#rt/>
+</#if>
 >