Commits

Anonymous committed 7d20e67

- new tag: ww:head
- re-ran docs and tld generation

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@1801573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (28)

docs/tags/Checkbox.html

 </p>
 
 <p>
-<!-- START SNIPPET: javadoc --> Renders an HTML input element of type checkbox, populated by the specified property from the OgnlValueStack. <!-- END SNIPPET: javadoc --> <p/> <b>Examples</b> <pre> <!-- START SNIPPET: example --> JSP: &lt;ww:checkbox label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/&gt; Velocity: #tag( Checkbox "label=checkbox test" "name=checkboxField1" "value=aBoolean" "fieldValue=true" ) Resulting HTML (simple template, aBoolean == true): &lt;input type="checkbox" name="checkboxField1" value="true" checked="checked" /&gt; <!-- END SNIPPET: example --> </pre>
+<!-- START SNIPPET: javadoc --> Renders an HTML input element of type checkbox, populated by the specified property from the OgnlValueStack. <!-- END SNIPPET: javadoc --> <p/> <b>Examples</b> <pre> <!-- START SNIPPET: example --> JSP: &lt;ww:checkbox label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/&gt; Velocity: #tag( Checkbox "label=checkbox test" "name=checkboxField1" "value=aBoolean" ) Resulting HTML (simple template, aBoolean == true): &lt;input type="checkbox" name="checkboxField1" value="true" checked="checked" /&gt; <!-- END SNIPPET: example --> </pre>
 </p>
 
 <h2>Attributes</h2>
 <td align="left" valign="top">fieldValue</td>
 
 <!-- Required -->
-<td align="left" valign="top"><b>true</b></td>
+<td align="left" valign="top">false</td>
 
 <!-- Default -->
 <td align="left" valign="top">&nbsp;</td>
 <td align="left" valign="top">Object/String</td>
 
 <!-- Description -->
-<td align="left" valign="top">The actual HTML value attribute of the checkbox</td>
+<td align="left" valign="top">The actual HTML value attribute of the checkbox, defaults to 'true'.</td>
 
 </tr>
 
+
+<html>
+<head>
+<title>&lt;ww:head /&gt;</title>
+</head>
+
+<body>
+
+<h1>Tag Name: &lt;ww:head /&gt;</h1>
+
+<h2>Description</h2>
+<p>
+
+Render a chunk of HEAD for your HTML file
+
+</p>
+
+<p>
+<!-- START SNIPPET: javadoc --> Renders parts of the HEAD section for an HTML file. This is useful as some themes require certain CSS and JavaScript includes. <!-- END SNIPPET: javadoc --> <p/> <b>Examples</b> <pre> <!-- START SNIPPET: example --> &lt;ww:head/&gt; <!-- END SNIPPET: example --> </pre>
+</p>
+
+<h2>Attributes</h2>
+<p>
+
+<!-- START SNIPPET: tagattributes -->
+<table width="100%">
+<tr>
+
+<th align="left" valign="top"><h4>Name</h4></th>
+<th align="left" valign="top"><h4>Required</h4></th>
+<th align="left" valign="top"><h4>Default</h4></th>
+<th align="left" valign="top"><h4>Type</h4></th>
+<th align="left" valign="top"><h4>Description</h4></th>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">theme</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">The theme (other than default) to use for renedring the element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">template</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">The template (other than default) to use for renedring the element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">cssClass</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">The css class to use for element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">cssStyle</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">The css style definitions for element ro use</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">disabled</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">label</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Label expression used for rendering a element specific label</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">labelPosition</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">left</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">deprecated.</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">labelposition</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">define label position of form element (top/left)</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">name</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">The name to set for element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">required</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">false</td>
+
+<!-- Type -->
+<td align="left" valign="top">Boolean</td>
+
+<!-- Description -->
+<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">tabindex</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html tabindex attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">value</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Preset the value of input element.</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onclick</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onclick attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">ondblclick</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html ondblclick attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onmousedown</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onmousedown attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onmouseup</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onmouseup attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onmouseover</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onmouseover attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onmousemove</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onmousemove attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onmouseout</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onmouseout attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onfocus</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onfocus attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onblur</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onblur attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onkeypress</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onkeypress attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onkeydown</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onkeydown attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onkeyup</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onkeyup attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onselect</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">onchange</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">Set the html onchange attribute on rendered html element</td>
+
+</tr>
+
+<tr>
+<!-- Attribute name -->
+<td align="left" valign="top">id</td>
+
+<!-- Required -->
+<td align="left" valign="top">false</td>
+
+<!-- Default -->
+<td align="left" valign="top">&nbsp;</td>
+
+<!-- Type -->
+<td align="left" valign="top">Object/String</td>
+
+<!-- Description -->
+<td align="left" valign="top">id for referencing element. For UI and form tags it will be used as HTML id attribute</td>
+
+</tr>
+
+</table>
+<!-- END SNIPPET: tagattributes -->
+
+</p>
+<p>
+<center><a href="index.html">Back to Taglib Index</a>
+</p>
+</body>
+</html>
+
 
 <tr>
 <td align="left" valign="top" width="20%">
+<a href="Head.html">&lt;head /&gt;</a>
+</td>
+<td align="left" valign="top" width="*">
+
+Render a chunk of HEAD for your HTML file
+
+</td>
+</tr>
+
+<tr>
+<td align="left" valign="top" width="20%">
 <a href="Push.html">&lt;push /&gt;</a>
 </td>
 <td align="left" valign="top" width="*">

src/java/META-INF/taglib.tld

 
    <tag>
 
+      <name>head</name>
+      <tag-class>com.opensymphony.webwork.views.jsp.ui.HeadTag</tag-class>
+      <body-content>empty</body-content>
+      <description><![CDATA[Render a chunk of HEAD for your HTML file]]></description>
+
+      <attribute>
+         <name>theme</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The theme (other than default) to use for renedring the element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>template</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The template (other than default) to use for renedring the element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>cssClass</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The css class to use for element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>cssStyle</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The css style definitions for element ro use]]></description>
+
+      </attribute>
+      <attribute>
+         <name>disabled</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html disabled attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>label</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Label expression used for rendering a element specific label]]></description>
+
+      </attribute>
+      <attribute>
+         <name>labelPosition</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[deprecated.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>labelposition</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[define label position of form element (top/left)]]></description>
+
+      </attribute>
+      <attribute>
+         <name>name</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The name to set for element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>required</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[If set to true, the rendered element will indicate that input is required]]></description>
+
+      </attribute>
+      <attribute>
+         <name>tabindex</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html tabindex attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>value</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Preset the value of input element.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onclick</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onclick attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>ondblclick</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html ondblclick attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmousedown</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmousedown attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseup</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseup attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseover</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseover attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmousemove</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmousemove attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseout</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseout attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onfocus</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onfocus attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onblur</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onblur attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeypress</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeypress attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeydown</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeydown attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeyup</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeyup attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onselect</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onselect attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onchange</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onchange attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>id</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[id for referencing element. For UI and form tags it will be used as HTML id attribute]]></description>
+
+      </attribute>
+
+   </tag>
+   <tag>
+
       <name>push</name>
       <tag-class>com.opensymphony.webwork.views.jsp.PushTag</tag-class>
       <body-content>JSP</body-content>

src/java/com/opensymphony/webwork/components/Head.java

+package com.opensymphony.webwork.components;
+
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ *
+ * Renders parts of the HEAD section for an HTML file. This is useful as some themes require certain CSS and JavaScript
+ * includes.
+ *
+ * <!-- END SNIPPET: javadoc -->
+ *
+ * <p/> <b>Examples</b>
+ *
+ * <pre>
+ * <!-- START SNIPPET: example -->
+ * &lt;ww:head/&gt;
+ * <!-- END SNIPPET: example -->
+ * </pre>
+ *
+ * @author Patrick Lightbody
+ * @ww.tag name="head" tld-body-content="empty" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.HeadTag"
+ * description="Render a chunk of HEAD for your HTML file"
+ * @since 2.2
+ */
+public class Head extends UIBean {
+    final public static String TEMPLATE = "head";
+
+    public Head(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) {
+        super(stack, request, response);
+    }
+
+    protected String getDefaultTemplate() {
+        return TEMPLATE;
+    }
+}

src/java/com/opensymphony/webwork/static/template/ajax/validation.js

-var webworkValidator = new ValidationClient("$!base/validation");
-webworkValidator.onErrors = function(input, errors) {
-
-	var table = input.parentNode.parentNode.parentNode;
-	var form = input.form;
-
-	clearErrorRows(table);
-	clearErrorLabels(form);
-
-    if (errors.fieldErrors) {
-        for (var fieldName in errors.fieldErrors) {
-            if (form.elements[fieldName].touched) {
-                for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
-                    addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
-                }
-            }
-        }
-    }
-}
-
-function validate(element) {
-    // mark the element as touch
-    element.touched = true;
-    var namespace = element.form.attributes['namespace'].nodeValue;
-    var actionName = element.form.attributes['name'].nodeValue;
-	webworkValidator.validate(element, namespace, actionName);
-}

src/java/com/opensymphony/webwork/static/template/css_xhtml/validation.js

-var webworkValidator = new ValidationClient("$!base/validation");
-webworkValidator.onErrors = function(input, errors) {
-	var form = input.form;
-	clearErrorParagraphs(form);
-	clearErrorLabels(form);
-
-    if (errors.fieldErrors) {
-        for (var fieldName in errors.fieldErrors) {
-            if (form.elements[fieldName].touched) {
-                for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
-                    addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
-                }
-            }
-        }
-    }
-}
-
-function validate(element) {
-    // mark the element as touch
-    element.touched = true;
-    var namespace = element.form.attributes['namespace'].nodeValue;
-    var actionName = element.form.attributes['name'].nodeValue;
-	webworkValidator.validate(element, namespace, actionName);
-}
-
-function clearErrorParagraphs(form) {
-    var divs = form.getElementsByTagName("div");
-
-    // clear out any rows with an "errorFor" attribute
-    var paragraphsToDelete = new Array();
-
-    for(var i = 0; i < divs.length; i++) {
-        var p = divs[i];
-        if (p.getAttribute("errorFor")) {
-            paragraphsToDelete.push(p);
-        }
-    }
-
-    // now delete the paragraphsToDelete
-    for (var i = 0; i < paragraphsToDelete.length; i++) {
-        var r = paragraphsToDelete[i];
-        var parent = r.parentNode;
-        parent.removeChild(r);
-    }
-}
-
-function clearErrorLabels(form) {
-    // set all labels back to the normal class
-    var labels = form.getElementsByTagName("label");
-    for (var i = 0; i < labels.length; i++) {
-        var label = labels[i];
-        if (label) {
-            if(label.getAttribute("class") == "errorLabel"){
-                label.setAttribute("class", "label");//standard way.. works for ie mozilla
-                label.setAttribute("className", "label"); //ie hack cause ie does not support setAttribute
-            }
-        }
-    }
-
-}
-
-
-function addError(e, errorText) {
-    try {
-        // clear out any rows with an "errorFor" of e.id
-        var div = e.parentNode;
-        var error = document.createTextNode(errorText);
-        var errorDiv = document.createElement("div");
-        var label = div.getElementsByTagName("label")[0];
-        label.setAttribute("class", "errorLabel"); //standard way.. works for ie mozilla
-        label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support setAttribute
-
-        errorDiv.setAttribute("class", "errorMessage");//standard way.. works for ie mozilla
-        errorDiv.setAttribute("className", "errorMessage");//ie hack cause ie does not support setAttribute
-        errorDiv.setAttribute("errorFor", e.id);;
-        errorDiv.appendChild(error);
-        div.insertBefore(errorDiv, label);
-    } catch (e) {
-        alert(e);
-    }
-}

src/java/com/opensymphony/webwork/static/template/xhtml/validation.js

-function clearErrorRows(table) {
-    // clear out any rows with an "errorFor" attribute
-    var rows = table.rows;
-    var rowsToDelete = new Array();
-    if (rows == null){
-        return;
-    }
-
-    for(var i = 0; i < rows.length; i++) {
-        var r = rows[i];
-        if (r.getAttribute("errorFor")) {
-            rowsToDelete.push(r);
-        }
-    }
-
-    // now delete the rows
-    for (var i = 0; i < rowsToDelete.length; i++) {
-        var r = rowsToDelete[i];
-        table.deleteRow(r.rowIndex);
-    }
-}
-
-function clearErrorLabels(form) {
-    // set all labels back to the normal class
-    var elements = form.elements;
-    for (var i = 0; i < elements.length; i++) {
-        var e = elements[i];
-        var cells = e.parentNode.parentNode.cells;
-        if (cells && cells.length >= 2) {
-            var label = cells[0].getElementsByTagName("label")[0];
-            if (label) {
-                label.setAttribute("class", "label");
-            }
-        }
-    }
-
-}
-
-function addError(e, errorText) {
-    try {
-        // clear out any rows with an "errorFor" of e.id
-        var row = e.parentNode.parentNode;
-        var table = row.parentNode;
-        var error = document.createTextNode(errorText);
-        var tr = document.createElement("tr");
-        var td = document.createElement("td");
-        var span = document.createElement("span");
-        td.align = "center";
-        td.valign = "top";
-        td.colSpan = 2;
-        span.setAttribute("class", "errorMessage");
-        span.appendChild(error);
-        td.appendChild(span);
-        tr.appendChild(td);
-        tr.setAttribute("errorFor", e.id);;
-        table.insertBefore(tr, row);
-
-        // updat the label too
-        var label = row.cells[0].getElementsByTagName("label")[0];
-        label.setAttribute("class", "errorLabel");
-    } catch (e) {
-        alert(e);
-    }
-}

src/java/com/opensymphony/webwork/views/freemarker/tags/HeadModel.java

+package com.opensymphony.webwork.views.freemarker.tags;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Head;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see Head
+ */
+public class HeadModel extends TagModel {
+    public HeadModel(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        super(stack, req, res);
+    }
+
+    protected Component getBean() {
+        return new Head(stack, req, res);
+    }
+}

src/java/com/opensymphony/webwork/views/freemarker/tags/WebWorkModels.java

     protected DoubleSelectModel doubleselect;
     protected FileModel file;
     protected FormModel form;
+    protected HeadModel head;
     protected HiddenModel hidden;
     protected AnchorModel a;
     protected I18nModel i18n;
         return form;
     }
 
+    public HeadModel getHead() {
+        if (head == null) {
+            head = new HeadModel(stack, req, res);
+        }
+
+        return head;
+    }
+
     public HiddenModel getHidden() {
         if (hidden == null) {
             hidden = new HiddenModel(stack, req, res);
 
         return hidden;
     }
-
     public LabelModel getLabel() {
         if (label == null) {
             label = new LabelModel(stack, req, res);

src/java/com/opensymphony/webwork/views/jsp/ui/HeadTag.java

+package com.opensymphony.webwork.views.jsp.ui;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Head;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see Head
+ */
+public class HeadTag extends AbstractUITag {
+    public Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        return new Head(stack, req, res);
+    }
+}

src/java/com/opensymphony/webwork/views/velocity/VelocityManager.java

         addDirective(sb, DoubleSelectDirective.class);
         addDirective(sb, FileDirective.class);
         addDirective(sb, FormDirective.class);
+        addDirective(sb, HeadDirective.class);
         addDirective(sb, HiddenDirective.class);
         addDirective(sb, AnchorDirective.class);
         addDirective(sb, I18nDirective.class);

src/java/com/opensymphony/webwork/views/velocity/components/HeadDirective.java

+package com.opensymphony.webwork.views.velocity.components;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Head;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see Head
+ */
+public class HeadDirective extends AbstractDirective {
+    protected Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        return new Head(stack, req, res);
+    }
+
+    public String getBeanName() {
+        return "head";
+    }
+}

src/java/template/ajax/dojoRequire.js

+dojo.require("dojo.io.BrowserIO");
+dojo.require("dojo.event.topic");
+dojo.require("webwork.widgets.Bind");
+dojo.require("webwork.widgets.BindDiv");
+dojo.require("webwork.widgets.BindButton");
+dojo.require("webwork.widgets.BindAnchor");
+dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger to work with the includes

src/java/template/ajax/form.ftl

 <script src="${base}/webwork/validationClient.js"></script>
 <script src="${base}/dwr/interface/validator.js"></script>
 <script src="${base}/dwr/engine.js"></script>
-<script src="${base}/webwork/template/ajax/validation.js"></script>
-<script src="${base}/webwork/template/xhtml/validation.js"></script>
+<script src="${base}/webwork/ajax/validation.js"></script>
+<script src="${base}/webwork/xhtml/validation.js"></script>
 </#if>
 <form<#rt/>
 <#if parameters.namespace?exists>

src/java/template/ajax/head.ftl

+<#include "/${parameters.templateDir}/xhtml/head.ftl" />
+<script language="JavaScript" type="text/javascript">
+    // Dojo configuration
+    djConfig = {
+        baseRelativePath: "<@ww.url includeParams='none' value='/webwork/dojo/'/>",
+        isDebug: false,
+        debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
+    };
+</script>
+<script language="JavaScript" type="text/javascript"
+        src="<@ww.url includeParams='none' value='/webwork/dojo/dojo.js' />"></script>
+<script language="JavaScript" type="text/javascript"
+        src="<@ww.url includeParams='none' value='/webwork/CommonFunctions.js' />"></script>
+<script language="JavaScript" type="text/javascript"
+        src="<@ww.url includeParams='none' value='/webwork/ajax/dojoRequire.js' />"></script>

src/java/template/ajax/submit.ftl

+<tr>
+    <td colspan="2"><div <#rt/>
+<#if parameters.align?exists>
+    align="${parameters.align?html}"<#t/>
+</#if>
+><#t/>
 <button type="submit" dojoType="BindButton"<#rt/>
 <#if parameters.form?exists && parameters.form.id?exists>
  formId="${parameters.form.id}"<#rt/>
 </#if>
 <#include "/${parameters.templateDir}/simple/scripting-events.ftl"/>
 />
+<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

src/java/template/ajax/validation.js

+var webworkValidator = new ValidationClient("$!base/validation");
+webworkValidator.onErrors = function(input, errors) {
+
+	var table = input.parentNode.parentNode.parentNode;
+	var form = input.form;
+
+	clearErrorRows(table);
+	clearErrorLabels(form);
+
+    if (errors.fieldErrors) {
+        for (var fieldName in errors.fieldErrors) {
+            if (form.elements[fieldName].touched) {
+                for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
+                    addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
+                }
+            }
+        }
+    }
+}
+
+function validate(element) {
+    // mark the element as touch
+    element.touched = true;
+    var namespace = element.form.attributes['namespace'].nodeValue;
+    var actionName = element.form.attributes['name'].nodeValue;
+	webworkValidator.validate(element, namespace, actionName);
+}

src/java/template/css_xhtml/validation.js

+var webworkValidator = new ValidationClient("$!base/validation");
+webworkValidator.onErrors = function(input, errors) {
+	var form = input.form;
+	clearErrorParagraphs(form);
+	clearErrorLabels(form);
+
+    if (errors.fieldErrors) {
+        for (var fieldName in errors.fieldErrors) {
+            if (form.elements[fieldName].touched) {
+                for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
+                    addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
+                }
+            }
+        }
+    }
+}
+
+function validate(element) {
+    // mark the element as touch
+    element.touched = true;
+    var namespace = element.form.attributes['namespace'].nodeValue;
+    var actionName = element.form.attributes['name'].nodeValue;
+	webworkValidator.validate(element, namespace, actionName);
+}
+
+function clearErrorParagraphs(form) {
+    var divs = form.getElementsByTagName("div");
+
+    // clear out any rows with an "errorFor" attribute
+    var paragraphsToDelete = new Array();
+
+    for(var i = 0; i < divs.length; i++) {
+        var p = divs[i];
+        if (p.getAttribute("errorFor")) {
+            paragraphsToDelete.push(p);
+        }
+    }
+
+    // now delete the paragraphsToDelete
+    for (var i = 0; i < paragraphsToDelete.length; i++) {
+        var r = paragraphsToDelete[i];
+        var parent = r.parentNode;
+        parent.removeChild(r);
+    }
+}
+
+function clearErrorLabels(form) {
+    // set all labels back to the normal class
+    var labels = form.getElementsByTagName("label");
+    for (var i = 0; i < labels.length; i++) {
+        var label = labels[i];
+        if (label) {
+            if(label.getAttribute("class") == "errorLabel"){
+                label.setAttribute("class", "label");//standard way.. works for ie mozilla
+                label.setAttribute("className", "label"); //ie hack cause ie does not support setAttribute
+            }
+        }
+    }
+
+}
+
+
+function addError(e, errorText) {
+    try {
+        // clear out any rows with an "errorFor" of e.id
+        var div = e.parentNode;
+        var error = document.createTextNode(errorText);
+        var errorDiv = document.createElement("div");
+        var label = div.getElementsByTagName("label")[0];
+        label.setAttribute("class", "errorLabel"); //standard way.. works for ie mozilla
+        label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support setAttribute
+
+        errorDiv.setAttribute("class", "errorMessage");//standard way.. works for ie mozilla
+        errorDiv.setAttribute("className", "errorMessage");//ie hack cause ie does not support setAttribute
+        errorDiv.setAttribute("errorFor", e.id);;
+        errorDiv.appendChild(error);
+        div.insertBefore(errorDiv, label);
+    } catch (e) {
+        alert(e);
+    }
+}

src/java/template/simple/head.ftl

Empty file added.

src/java/template/xhtml/form-validate.ftl

 <#if parameters.validate?default(false) == true>
-<script src="${base}/webwork/template/xhtml/validation.js"></script>
+<script src="${base}/webwork/xhtml/validation.js"></script>
     <#if parameters.onsubmit?exists>
         ${tag.addParameter('onsubmit', "return validateForm_${parameters.id}();${parameters.onblur}")}
     <#else>

src/java/template/xhtml/head.ftl

+<link rel="stylesheet" href="<@ww.url value='/webwork/xhtml/styles.css' />" type="text/css"/>

src/java/template/xhtml/validation.js

+function clearErrorRows(table) {
+    // clear out any rows with an "errorFor" attribute
+    var rows = table.rows;
+    var rowsToDelete = new Array();
+    if (rows == null){
+        return;
+    }
+
+    for(var i = 0; i < rows.length; i++) {
+        var r = rows[i];
+        if (r.getAttribute("errorFor")) {
+            rowsToDelete.push(r);
+        }
+    }
+
+    // now delete the rows
+    for (var i = 0; i < rowsToDelete.length; i++) {
+        var r = rowsToDelete[i];
+        table.deleteRow(r.rowIndex);
+    }
+}
+
+function clearErrorLabels(form) {
+    // set all labels back to the normal class
+    var elements = form.elements;
+    for (var i = 0; i < elements.length; i++) {
+        var e = elements[i];
+        var cells = e.parentNode.parentNode.cells;
+        if (cells && cells.length >= 2) {
+            var label = cells[0].getElementsByTagName("label")[0];
+            if (label) {
+                label.setAttribute("class", "label");
+            }
+        }
+    }
+
+}
+
+function addError(e, errorText) {
+    try {
+        // clear out any rows with an "errorFor" of e.id
+        var row = e.parentNode.parentNode;
+        var table = row.parentNode;
+        var error = document.createTextNode(errorText);
+        var tr = document.createElement("tr");
+        var td = document.createElement("td");
+        var span = document.createElement("span");
+        td.align = "center";
+        td.valign = "top";
+        td.colSpan = 2;
+        span.setAttribute("class", "errorMessage");
+        span.appendChild(error);
+        td.appendChild(span);
+        tr.appendChild(td);
+        tr.setAttribute("errorFor", e.id);;
+        table.insertBefore(tr, row);
+
+        // updat the label too
+        var label = row.cells[0].getElementsByTagName("label")[0];
+        label.setAttribute("class", "errorLabel");
+    } catch (e) {
+        alert(e);
+    }
+}

webapps/ajax/src/webapp/commonInclude.jsp

 <%@ taglib prefix="ww" uri="/webwork" %>
 <!--// START SNIPPET: common-include-->
-<script language="JavaScript" type="text/javascript">
-    // Dojo configuration
-    djConfig = {
-        baseRelativePath: "<ww:url includeParams="none" value="/webwork/dojo/"/>",
-        isDebug: false,
-        debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
-    };
-</script>
-
-<script language="JavaScript" type="text/javascript"
-        src="<ww:url includeParams="none" value="/webwork/dojo/dojo.js" />"></script>
-<script language="JavaScript" type="text/javascript"
-        src="<ww:url includeParams="none" value="/webwork/CommonFunctions.js" />"></script>
-
-<script language="JavaScript" type="text/javascript">
-    dojo.require("dojo.io.BrowserIO");
-    dojo.require("dojo.event.topic");
-    dojo.require("webwork.widgets.Bind");
-    dojo.require("webwork.widgets.BindDiv");
-    dojo.require("webwork.widgets.BindButton");
-    dojo.require("webwork.widgets.BindAnchor");
-    dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger to work with the includes
-</script>
+<ww:head theme="ajax"/>
 <!--// END SNIPPET: common-include-->

webapps/showcase/src/webapp/tags/ui/example.jsp

 <html>
 <head>
     <title>UI Tags Example</title>
-    <link rel="stylesheet" href="<ww:url value="/webwork/xhtml/styles.css"/>" type="text/css"/>
+    <ww:head/>
 </head>
 
 <body>

webapps/showcase/src/webapp/validation/quiz-ajax.jsp

 <html>
 <head>
     <title>Validation - Basic</title>
-    <link rel="stylesheet" href="<ww:url value="/webwork/xhtml/styles.css"/>" type="text/css"/>
+    <ww:head theme="ajax"/>
 </head>
 
 <body>
 
+<div id='two' style="border: 1px solid yellow;"><b>initial content</b></div>
 <ww:form method="post" validate="true" theme="ajax">
     <ww:textfield label="Name" name="name"/>
     <ww:textfield label="Age" name="age"/>
     <ww:textfield label="Favorite color" name="answer"/>
-    <ww:submit/>
+    <ww:submit resultDivId="two"/>
 </ww:form>
 
 </body>

webapps/showcase/src/webapp/validation/quiz-basic.jsp

 <html>
 <head>
     <title>Validation - Basic</title>
-    <link rel="stylesheet" href="<ww:url value="/webwork/xhtml/styles.css"/>" type="text/css"/>
+    <ww:head/>
 </head>
 
 <body>

webapps/showcase/src/webapp/validation/quiz-client.jsp

 <html>
 <head>
     <title>Validation - Basic</title>
-    <link rel="stylesheet" href="<ww:url value="/webwork/xhtml/styles.css"/>" type="text/css"/>
+    <ww:head/>
 </head>
 
 <body>