Index: src/java/META-INF/taglib.tld
===================================================================
RCS file: /cvs/webwork/src/java/META-INF/taglib.tld,v
retrieving revision 1.69
diff -u -r1.69 taglib.tld
--- src/java/META-INF/taglib.tld	23 Mar 2006 20:15:11 -0000	1.69
+++ src/java/META-INF/taglib.tld	19 May 2006 23:27:17 -0000
@@ -1918,6 +1918,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>
Index: src/java/com/opensymphony/webwork/components/Form.java
===================================================================
RCS file: /cvs/webwork/src/java/com/opensymphony/webwork/components/Form.java,v
retrieving revision 1.29
diff -u -r1.29 Form.java
--- src/java/com/opensymphony/webwork/components/Form.java	18 Mar 2006 15:49:26 -0000	1.29
+++ src/java/com/opensymphony/webwork/components/Form.java	19 May 2006 23:27:17 -0000
@@ -34,6 +34,24 @@
  * The remote form allows the form to be submitted without the page being refreshed. The results from the form
  * can be inserted into any HTML element on the page.<p/>
  *
+ * NOTE:<p/>
+ * The order / logic in determining the posting url of the generated HTML form is as follows:-
+ * <ol>
+ * 	 <li>
+ * 	 If the action attribute is not specified, then the current request will be used to
+ *   determine the posting url
+ *   </li>
+ *   <li>
+ *   If the action is given, SAF will try to obtain an ActionConfig. This will be
+ *   successfull if the action attribute is a valid action alias defined xwork.xml.
+ *   </li>
+ *   <li>
+ *   If the action is given and is not an action alias defined in xwork.xmlm SAF
+ *   will used the action attribute as if it is the posting url, separting the namespace
+ *   from it and using UrlHelper to generate the final url.
+ *   </li>
+ * </ol>
+ *
  * <!-- END SNIPPET: javadoc -->
  *
  * <p/> <b>Examples</b>
@@ -69,6 +87,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);
@@ -131,6 +150,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")) {
@@ -158,15 +181,16 @@
             }
         }
 
+        String actionMethod = "";
+        if (action.indexOf("!") != -1) {
+            int endIdx = action.lastIndexOf("!");
+            actionMethod = action.substring(endIdx + 1, action.length());
+            action = action.substring(0, endIdx);
+        }
+
         final ActionConfig actionConfig = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, action);
         String actionName = action;
         if (actionConfig != null) {
-            String actionMethod = "";
-            if (action.indexOf("!") != -1) {
-                int endIdx = action.lastIndexOf("!");
-                actionMethod = action.substring(endIdx + 1, action.length());
-                action = action.substring(0, endIdx);
-            }
 
             ActionMapping mapping = new ActionMapping(action, namespace, actionMethod, parameters);
             String result = UrlHelper.buildUrl(ActionMapperFactory.getMapper().getUriFromActionMapping(mapping), request, response, null);
@@ -357,5 +381,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;
     }
 }
Index: src/java/com/opensymphony/webwork/components/Text.java
===================================================================
RCS file: /cvs/webwork/src/java/com/opensymphony/webwork/components/Text.java,v
retrieving revision 1.19
diff -u -r1.19 Text.java
--- src/java/com/opensymphony/webwork/components/Text.java	18 Mar 2006 16:24:47 -0000	1.19
+++ src/java/com/opensymphony/webwork/components/Text.java	19 May 2006 23:27:17 -0000
@@ -71,9 +71,15 @@
  * 
  * <pre>
  * <!-- START SNIPPET: i18nExample -->
- * 
+ *
+ * &lt;-- Third Example --&gt;
  * &lt;ww:text name="some.key" /&gt;
- * 
+ *
+ * &lt;-- Fourth Example --&gt;
+ * &lt;a:text name="some.invalid.key" &gt;
+ *    The Default Message That Will Be Displayed
+ * &lt;/a:text&gt;
+ *
  * <!-- END SNIPPET: i18nExample -->
  * </pre>
  * 
@@ -107,6 +113,13 @@
      */
     public void setName(String name) {
         this.name = name;
+    }
+
+    public boolean usesBody() {
+    	// overriding this to true such that EVAL_BODY_BUFFERED is return and
+    	// bodyContent will be valid hence, text between start & end tag will
+    	// be honoured as default message (WW-1268)
+    	return true;
     }
 
     public boolean end(Writer writer, String body) {
Index: src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java
===================================================================
RCS file: /cvs/webwork/src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java,v
retrieving revision 1.40
diff -u -r1.40 FormTag.java
--- src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java	24 Jan 2006 10:43:03 -0000	1.40
+++ src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java	19 May 2006 23:27:18 -0000
@@ -25,6 +25,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);
@@ -42,6 +43,7 @@
         form.setOnsubmit(onsubmit);
         form.setPortletMode(portletMode);
         form.setWindowState(windowState);
+        form.setAcceptcharset(acceptcharset);
     }
 
 
@@ -80,4 +82,8 @@
     public void setWindowState(String windowState) {
         this.windowState = windowState;
     }
-}
+
+    public void setAcceptcharset(String acceptcharset) {
+        this.acceptcharset = acceptcharset;
+    }
+}
\ No newline at end of file
Index: src/java/template/simple/form.ftl
===================================================================
RCS file: /cvs/webwork/src/java/template/simple/form.ftl,v
retrieving revision 1.11
diff -u -r1.11 form.ftl
--- src/java/template/simple/form.ftl	10 Mar 2006 14:58:05 -0000	1.11
+++ src/java/template/simple/form.ftl	19 May 2006 23:27:18 -0000
@@ -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>
 >
Index: src/test/com/opensymphony/webwork/views/jsp/TextTagTest.java
===================================================================
RCS file: /cvs/webwork/src/test/com/opensymphony/webwork/views/jsp/TextTagTest.java,v
retrieving revision 1.6
diff -u -r1.6 TextTagTest.java
--- src/test/com/opensymphony/webwork/views/jsp/TextTagTest.java	19 Mar 2006 11:33:54 -0000	1.6
+++ src/test/com/opensymphony/webwork/views/jsp/TextTagTest.java	19 May 2006 23:27:18 -0000
@@ -9,11 +9,18 @@
 import com.opensymphony.webwork.components.Text;
 import com.opensymphony.webwork.views.jsp.ui.TestAction1;
 import com.opensymphony.webwork.views.jsp.ui.WebWorkBodyContent;
+
+import com.mockobjects.servlet.MockBodyContent;
+import com.mockobjects.servlet.MockJspWriter;
 import com.opensymphony.xwork.Action;
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.util.OgnlValueStack;
 
 import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTag;
+import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.jsp.tagext.TagSupport;
+
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -38,6 +45,22 @@
         action.setFoo(fooValue);
 
         return action;
+    }
+
+    public void testDefaultMessageOk() throws Exception {
+    	// NOTE:
+    	// simulate the condition
+    	// <saf:text name="some.invalid.key">My Default Message</saf:text>
+
+    	WebWorkMockBodyContent mockBodyContent = new WebWorkMockBodyContent(new MockJspWriter());
+    	mockBodyContent.setString("Sample Of Default Message");
+    	tag.setBodyContent(mockBodyContent);
+    	tag.setName("some.invalid.key.so.we.should.get.the.default.message");
+    	int startStatus = tag.doStartTag();
+    	tag.doEndTag();
+
+    	assertEquals(startStatus, BodyTag.EVAL_BODY_BUFFERED);
+    	assertEquals("Sample Of Default Message", writer.toString());
     }
 
     public void testExpressionsEvaluated() throws Exception {
Index: src/test/com/opensymphony/webwork/views/jsp/ui/FormTagTest.java
===================================================================
RCS file: /cvs/webwork/src/test/com/opensymphony/webwork/views/jsp/ui/FormTagTest.java,v
retrieving revision 1.30
diff -u -r1.30 FormTagTest.java
--- src/test/com/opensymphony/webwork/views/jsp/ui/FormTagTest.java	17 Mar 2006 09:46:18 -0000	1.30
+++ src/test/com/opensymphony/webwork/views/jsp/ui/FormTagTest.java	19 May 2006 23:27:18 -0000
@@ -24,6 +24,47 @@
  */
 public class FormTagTest extends AbstractUITagTest {
 
+   	public void testFormWithActionAttributeContainingBothActionAndMethod() throws Exception {
+		TestAction testAction = (TestAction) action;
+
+		FormTag tag = new FormTag();
+		tag.setPageContext(pageContext);
+		tag.setName("myForm");
+		tag.setMethod("POST");
+        tag.setAcceptcharset("UTF-8");
+        tag.setAction("testAction!myLittleMethod");
+        tag.setEnctype("myEncType");
+        tag.setTitle("mytitle");
+        tag.setOnsubmit("submitMe()");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(FormTag.class.getResource("Formtag-9.txt"));
+	}
+
+
+	public void testFormWithActionAttributeContainingBothActionAndMethodAndNamespace() throws Exception {
+		TestAction testAction = (TestAction) action;
+
+		FormTag tag = new FormTag();
+		tag.setPageContext(pageContext);
+		tag.setName("myForm");
+		tag.setNamespace("/testNamespace");
+		tag.setMethod("POST");
+        tag.setAcceptcharset("UTF-8");
+        tag.setAction("testNamespaceAction!myLittleMethod");
+        tag.setEnctype("myEncType");
+        tag.setTitle("mytitle");
+        tag.setOnsubmit("submitMe()");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(FormTag.class.getResource("Formtag-10.txt"));
+	}
+
+
     public void testForm() throws Exception {
         request.setupGetServletPath("/testAction");

Index: src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-9.txt
===================================================================
RCS file: src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-9.txt
diff -N src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-9.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-9.txt        19 May 2006 23:28:40 -0000
@@ -0,0 +1,6 @@
+<form id="testAction" name="myForm" onsubmit="submitMe(); customOnsubmit(); return true;" action="/testAction!myLittleMethod.action" method="POST" enctype="myEncType" title="mytitle" accept-charset="UTF-8">
+<table class="wwFormTable">
+</table>
+</form>
+
+<script>functioncustomOnsubmit(){}</script>
\ No newline at end of file
Index: src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-10.txt
===================================================================
RCS file: src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-10.txt
diff -N src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-10.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/test/com/opensymphony/webwork/views/jsp/ui/Formtag-10.txt       19 May 2006 23:28:47 -0000
@@ -0,0 +1,6 @@
+<form id="testNamespaceAction" name="myForm" onsubmit="submitMe(); customOnsubmit(); return true;" action="/testNamespace/testNamespaceAction!myLittleMethod.action" method="POST" enctype="myEncType" title="mytitle" accept-charset="UTF-8">
+<table class="wwFormTable">
+</table>
+</form>
+
+<script>functioncustomOnsubmit(){}</script>
\ No newline at end of file
