You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by do...@apache.org on 2004/11/04 16:35:12 UTC
svn commit: rev 56599 - in incubator/beehive/trunk/netui: src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl src/tags-html/org/apache/beehive/netui/tags src/tags-html/org/apache/beehive/netui/tags/html src/tags-html/org/apache/beehive/netui/tags/rendering src/tags-html/org/apache/beehive/netui/tags/tree test/webapps/drt/testRecorder/tests
Author: dolander
Date: Thu Nov 4 07:35:11 2004
New Revision: 56599
Added:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/WriteRenderAppender.java
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/AnchorColumnModel.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/ImageColumnModel.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/LiteralColumnModel.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBox.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Content.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FileUpload.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDefaultableDataSourceTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Image.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageButton.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Label.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptHeader.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Span.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextArea.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AnchorTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BodyTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/CaptionTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ConstantRendering.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/DivTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ImageTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputBooleanTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputFileTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputHiddenTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputImageTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputSubmitTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputTextTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/LabelTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/OptionTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SelectTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SpanTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TableTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagHtmlBase.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TdTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TextAreaTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TrTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/B35084b.xml
Log:
Add a layer to the renderers which allows them to output to a Response or a StringBuilder
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/AnchorColumnModel.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/AnchorColumnModel.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/AnchorColumnModel.java Thu Nov 4 07:35:11 2004
@@ -25,10 +25,7 @@
import org.apache.beehive.netui.util.ParamHelper;
import org.apache.beehive.netui.util.logging.Logger;
-import org.apache.beehive.netui.tags.rendering.AnchorTag;
-import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
-import org.apache.beehive.netui.tags.rendering.SpanTag;
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+import org.apache.beehive.netui.tags.rendering.*;
/**
*
@@ -97,11 +94,12 @@
TagRenderingBase span = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, getHttpServletRequest());
StringBuilder sb = new StringBuilder();
- trb.doStartTag(sb, _anchorState);
- span.doStartTag(sb, spanState);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ trb.doStartTag(writer, _anchorState);
+ span.doStartTag(writer, spanState);
sb.append(getValue());
- span.doEndTag(sb);
- trb.doEndTag(sb);
+ span.doEndTag(writer);
+ trb.doEndTag(writer);
buffer.append(sb.toString());
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/ImageColumnModel.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/ImageColumnModel.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/ImageColumnModel.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
import org.apache.beehive.netui.tags.rendering.ImageTag;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
import org.apache.beehive.netui.tags.html.HtmlConstants;
/**
@@ -83,9 +84,10 @@
{
StringBuilder sb = new StringBuilder();
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.IMAGE_TAG, getHttpServletRequest());
- br.doStartTag(sb, _imageState);
- br.doEndTag(sb);
+ br.doStartTag(writer, _imageState);
+ br.doEndTag(writer);
buffer.append(sb.toString());
}
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/LiteralColumnModel.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/LiteralColumnModel.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/impl/LiteralColumnModel.java Thu Nov 4 07:35:11 2004
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.SpanTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
public class LiteralColumnModel
extends AbstractHtmlColumnModel
@@ -42,9 +43,10 @@
String formatted = formatText(_value);
StringBuilder sb = new StringBuilder();
- span.doStartTag(sb, _state);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ span.doStartTag(writer, _state);
sb.append(formatted);
- span.doEndTag(sb);
+ span.doEndTag(writer);
buffer.append(sb.toString());
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java Thu Nov 4 07:35:11 2004
@@ -2,8 +2,10 @@
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.struts.util.ResponseUtils;
import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.JspTag;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.util.ArrayList;
@@ -250,6 +252,58 @@
sb.append(s);
}
+ /**
+ * This method get the current errors and write the formated output
+ * @param pc
+ */
+ public static void reportCollectedErrors(PageContext pc,JspTag tag)
+ {
+ IErrorReporter er = getErrorReporter(tag);
+ if (er == null)
+ return;
+
+ assert (pc != null);
+ ArrayList errors = er.returnErrors();
+ if (errors == null || errors.size() == 0)
+ return;
+
+ assert(errors.size() > 0);
+
+ String s;
+ // write the error header
+ s = Bundle.getString("Footer_Error_Header");
+ write(pc,s);
+
+ int cnt = errors.size();
+ Object[] args = new Object[5];
+ for (int i = 0; i < cnt; i++) {
+ Object o = errors.get(i);
+ assert (o != null);
+ if (o instanceof EvalErrorInfo) {
+ EvalErrorInfo err = (EvalErrorInfo) o;
+ args[0] = Integer.toString(err.errorNo);
+ args[1] = err.tagType;
+ args[2] = err.attr;
+ args[3] = err.expression;
+ args[4] = err.evalExcp.getMessage();
+ s = Bundle.getString("Footer_Error_Expr_Body", args);
+ write(pc,s);
+ }
+ else if (o instanceof TagErrorInfo) {
+ TagErrorInfo tei = (TagErrorInfo) o;
+ args[0] = Integer.toString(tei.errorNo);
+ args[1] = tei.tagType;
+ args[2] = tei.message;
+ s = Bundle.getString("Footer_Error_Tag_Body", args);
+ write(pc,s);
+ }
+ }
+
+ // write the error footer
+ s = Bundle.getString("Footer_Error_Footer");
+ write(pc,s);
+ }
+
private boolean isInlineErrors() {
AbstractPageError info = (AbstractPageError) _errors.get(0);
return (info.errorNo > 0);
@@ -301,5 +355,15 @@
er = (IErrorReporter) SimpleTagSupport.findAncestorWithClass((JspTag) er,IErrorReporter.class);
}
return null;
+ }
+
+ private static final void write(PageContext pc, String string)
+ {
+ try {
+ ResponseUtils.write(pc, string);
+ }
+ catch (JspException e) {
+ logger.error(Bundle.getString("Tags_WriteException"), e);
+ }
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java Thu Nov 4 07:35:11 2004
@@ -17,6 +17,8 @@
*/
package org.apache.beehive.netui.tags;
+import javax.servlet.jsp.PageContext;
+
/**
* A <code>ScriptReporter</code> acts as a container for JavaScript generated by children of
* the tag. Usually a <code>ScriptReporter</code> will gather up all of the JavaScript
@@ -71,6 +73,7 @@
* @param sb The script is written into the provided StringBuilder. This value must not be null.
*/
void writeScript(StringBuilder sb);
+ void writeScript(PageContext pc);
/**
* This method will output all of the Script that appears inside the <head> tag.
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java Thu Nov 4 07:35:11 2004
@@ -21,11 +21,12 @@
import org.apache.beehive.netui.pageflow.util.PageflowTagUtils;
import org.apache.beehive.netui.pageflow.util.URLRewriter;
import org.apache.beehive.netui.pageflow.util.URLRewriterService;
-import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.HtmlUtils;
+import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.AnchorTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.FileUtils;
import org.apache.beehive.netui.util.ParamHelper;
@@ -54,9 +55,7 @@
* <li>page - The module-relative page URL to which this hyperlink will be rendered.</li>
* </ul>
* </p>
-
- * @jsptagref.tagdescription
- * <p>
+ * @jsptagref.tagdescription <p>
* Generates an anchor that can link to another document or invoke an action method in the Controller file.
* The <netui:anchor> tag also supports JavaScript-based form submission and URL re-writing.
* <p>
@@ -71,9 +70,7 @@
* </ul>
* </blockquote>
* </p>
- *
- * @example
- * <b>Submitting Form Data</b>
+ * @example <b>Submitting Form Data</b>
* <p>In this sample, clicking on this anchor submits the form data and invokes the method
* <code>submitForm</code>.
* <pre>
@@ -100,7 +97,7 @@
* }</pre>
* <p> The JavaScript function will be invoked by the generated HTML anchor tag as follows:
* <pre>
- * <a href="/WebApp/tagSamples/anchor/formSubmit.do"
+ * <a href="/WebApp/tagSamples/anchor/formSubmit.do"
* onClick='anchor_submit_form("Netui_Form_0","/WebApp/tagSamples/anchor/formSubmit.do");return false;'>Submit</a></pre>
* <p>
* <b>Custom JavaScript Functions</b>
@@ -109,30 +106,28 @@
* do additional work, for example form validation, and still POST the form correctly. To
* accomplish this, add the custom JavaScript method to the page:
* <pre>
- * function SubmitFromAnchor()
- * {
+ * function SubmitFromAnchor()
+ * {
* // implement custom logic here
*
- * for(var i=0; i<document.forms.length; i++)
- * {
+ * for(var i=0; i<document.forms.length; i++)
+ * {
* // submit to the action /aWebapp/formPost.do
- * if (document.forms[i].action == "/aWebapp/formPost.do")
- * {
- * document.forms[i].method="POST";
- * document.forms[i].action="/aWebapp/formPost.do";
- * document.forms[i].submit();
- * }
- * }
+ * if (document.forms[i].action == "/aWebapp/formPost.do")
+ * {
+ * document.forms[i].method="POST";
+ * document.forms[i].action="/aWebapp/formPost.do";
+ * document.forms[i].submit();
+ * }
+ * }
* }</pre>
* Then reference the JavaScript method from the <netui:anchor> tag:
* <pre>
* <netui:anchor formSubmit="true" onClick="SubmitFromAnchor(); return false;">Submit</netui:anchor></pre>
- *
- * @see Attribute
- * @see java.lang.String
- *
* @netui:tag name="anchor" description="Generates a URL-encoded hyperlink to a specified URI."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.AnchorRenderer" whitespace="indent"
+ * @see Attribute
+ * @see java.lang.String
*/
public class Anchor extends HtmlBaseTag
implements URLParams
@@ -201,34 +196,26 @@
/**
* Set the name of the action for the Anchor.
* @param action - the name of the action to set for the Anchor. Action requires a value.
- *
- * @jsptagref.attributedescription
- * The action method to invoke. The action method must be in the Controller file
- * of the Page Flow directory.
+ * @jsptagref.attributedescription The action method to invoke. The action method must be in the Controller file
+ * of the Page Flow directory.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_action</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The action method to invoke. The action method must be in the Controller file of the Page Flow directory."
* @netui.tldx:attribute reftype="netui-action-url" category="general"
*/
public void setAction(String action)
- throws JspException
+ throws JspException
{
- _action = setRequiredValueAttribute(action,"action");
+ _action = setRequiredValueAttribute(action, "action");
}
/**
* Set the name of the action for the Anchor.
* @param scope - the name of the action to set for the Anchor
- *
- * @jsptagref.attributedescription
- * The scope
- *
+ * @jsptagref.attributedescription The scope
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_scope</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The scope"
* @netui.tldx:attribute category="general"
@@ -241,16 +228,12 @@
/**
* Sets the formSubmit indicator.
* @param formSubmit - whether or not the enclosing Form should be submitted.
- * @jsptagref.attributedescription
- * Boolean. If <code>formSubmit</code> is set to true, and the <netui:anchor> tag
- * is within a <netui:form> tag,
- * then the form data will be submitted to the method named in the
- * <netui:form> tag's <code>action</code> attribute.
- *
+ * @jsptagref.attributedescription Boolean. If <code>formSubmit</code> is set to true, and the <netui:anchor> tag
+ * is within a <netui:form> tag,
+ * then the form data will be submitted to the method named in the
+ * <netui:form> tag's <code>action</code> attribute.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_formSubmit</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="If formSubmit is set to true, and the <netui:anchor> tag
* is within a <netui:form> tag,
@@ -266,13 +249,9 @@
/**
* Sets the onClick javascript event.
* @param onclick - the onClick event.
- * @jsptagref.attributedescription
- * The onClick JavaScript event.
- *
+ * @jsptagref.attributedescription The onClick JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onClick</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onClick JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -285,14 +264,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key."
@@ -306,17 +281,13 @@
/**
* Sets the href of the Anchor. This attribute will accept the empty String as a legal value.
* @param href - the hyperlink URI for the Anchor.
- * @jsptagref.attributedescription
- * The URL to go to.
- *
+ * @jsptagref.attributedescription The URL to go to.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_href</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The URL to go to."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass"
- * reftype="url"
+ * reftype="url"
*/
public void setHref(String href)
throws JspException
@@ -328,53 +299,40 @@
* Set a client action to run on the client. When set on an anchor, a NetUI JavaScript action
* will be run. This attribute may not be set if <code>href</code> or <code>action</code> is set.
* @param action an action to run on the client.
- *
- * @jsptagref.attributedescription
- * The client action.
- *
+ * @jsptagref.attributedescription The client action.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_client_action</i>
- *
* @netui:attribute required="false" rtexprvalue="true" description="The client action."
* description="The client action."
*/
public void setClientAction(String action)
- throws JspException
+ throws JspException
{
- _clientAction = setRequiredValueAttribute(action,"clientAction");
+ _clientAction = setRequiredValueAttribute(action, "clientAction");
}
/**
* Sets the link name of the Anchor.
* @param linkName - the link name for the Anchor.
- * @jsptagref.attributedescription
- * An internal place on the page to go to.
- *
+ * @jsptagref.attributedescription An internal place on the page to go to.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_linkName</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="An internal place on the page to go to."
* @netui.tldx:attribute
*/
public void setLinkName(String linkName)
- throws JspException
+ throws JspException
{
- _linkName = setRequiredValueAttribute(linkName,"linkName");
+ _linkName = setRequiredValueAttribute(linkName, "linkName");
}
/**
* Sets the anchor to be added to the end of the generated hyperlink.
* @param location - the name of the location anchor.
- * @jsptagref.attributedescription
- * Location within the URI to visit.
- *
+ * @jsptagref.attributedescription Location within the URI to visit.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_location</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="Location within the URI to visit."
* @netui.tldx:attribute
@@ -387,14 +345,9 @@
/**
* Sets <code>charset</code> attribute for the anchor.
* @param charSet - the window target.
- *
- * @jsptagref.attributedescription
- * The character set.
- *
+ * @jsptagref.attributedescription The character set.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_charset</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The character set."
* @netui.tldx:attribute category="misc"
@@ -407,14 +360,9 @@
/**
* Sets <code>type</code> attribute for the anchor.
* @param type - the window target.
- *
- * @jsptagref.attributedescription
- * The type.
- *
+ * @jsptagref.attributedescription The type.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_type</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The type."
* @netui.tldx:attribute category="misc"
@@ -427,14 +375,9 @@
/**
* Sets <code>hreflang</code> attribute for the anchor.
* @param hreflang - the window target.
- *
- * @jsptagref.attributedescription
- * The HREF lang.
- *
+ * @jsptagref.attributedescription The HREF lang.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_hreflang</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The HREF lang."
* @netui.tldx:attribute category="misc"
@@ -447,14 +390,9 @@
/**
* Sets <code>rel</code> attribute for the anchor.
* @param rel - the window target.
- *
- * @jsptagref.attributedescription
- * The rel.
- *
+ * @jsptagref.attributedescription The rel.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_rel</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The rel."
* @netui.tldx:attribute category="misc"
@@ -467,14 +405,9 @@
/**
* Sets <code>rev</code> attribute for the anchor.
* @param rev - the window target.
- *
- * @jsptagref.attributedescription
- * The rev.
- *
+ * @jsptagref.attributedescription The rev.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_rev</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The rev."
* @netui.tldx:attribute category="misc"
@@ -487,14 +420,9 @@
/**
* Sets <code>shape</code> attribute for the anchor.
* @param shape - the window target.
- *
- * @jsptagref.attributedescription
- * The shape.
- *
+ * @jsptagref.attributedescription The shape.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_shape</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The shape."
* @netui.tldx:attribute category="misc"
@@ -507,14 +435,9 @@
/**
* Sets <code>coords</code> attribute for the anchor.
* @param coords - the window target.
- *
- * @jsptagref.attributedescription
- * The coordinates.
- *
+ * @jsptagref.attributedescription The coordinates.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_coordinates</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The coordinates."
* @netui.tldx:attribute category="misc"
@@ -527,13 +450,9 @@
/**
* Sets the window target.
* @param target - the window target.
- * @jsptagref.attributedescription
- * The window target.
- *
+ * @jsptagref.attributedescription The window target.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_action</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The window target."
* @netui.tldx:attribute category="misc"
@@ -596,29 +515,29 @@
return reportAndExit(EVAL_PAGE);
// build the anchor into the results
- StringBuilder results = new StringBuilder(32 + ((_text != null) ? _text.length() : 0));
+ //StringBuilder results = new StringBuilder(32 + ((_text != null) ? _text.length() : 0));
StringBuilder script = new StringBuilder(32);
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
TagRenderingBase trb = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, request);
- if (!createAnchorBeginTag(request, results, script, trb)) {
+ if (!createAnchorBeginTag(request, script, trb)) {
if (script.length() > 0)
ResponseUtils.write(pageContext, script.toString());
return reportAndExit(EVAL_PAGE);
}
if (_text != null)
- results.append(_text);
+ write(_text);
assert(trb != null) : "trb is null";
- trb.doEndTag(results);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ trb.doEndTag(writer);
if (script.length() > 0)
- results.append(script.toString());
+ write(script.toString());
// Render the remainder to the output stream
- ResponseUtils.write(pageContext, results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -626,13 +545,12 @@
/**
* This method will create the <a> portion of an anchor. It is called by subclasses, for example, the
* <code>ImageAnchor</code> relies on this code to generate the <a>.
- * @param results a <code>StringBuilder</coce> to write the anchor into
- * @param script a <code>StringBuilder</code> that will contain any JavaScript that may need to be added
- * to the generated HTML response.
+ * @param script a <code>StringBuilder</code> that will contain any JavaScript that may need to be added
+ * to the generated HTML response.
* @return a boolean value indicating if an error occur creating the anchor.
* @throws JspException
*/
- protected final boolean createAnchorBeginTag(HttpServletRequest request, StringBuilder results, StringBuilder script,
+ protected final boolean createAnchorBeginTag(HttpServletRequest request, StringBuilder script,
TagRenderingBase trb)
throws JspException
{
@@ -657,7 +575,7 @@
// if only the _linkName or _tagId is set then we are creating the name attribute only.
if (have == 0 && tagId != null) {
- return createNameAnchor(results, request, tagId, trb);
+ return createNameAnchor(request, tagId, trb);
}
// if the anchor is submitting a consider this a submit level problem
@@ -674,20 +592,20 @@
// if we have not specified a destination or we've specified too many
// then we need to report an error.
if (have == 0 || have > 1) {
- String s = Bundle.getString("Tags_Anchor_InvalidAnchorURI", new Object[] {REQUIRED_ATTR});
+ String s = Bundle.getString("Tags_Anchor_InvalidAnchorURI", new Object[]{REQUIRED_ATTR});
registerTagError(s, null);
return false;
}
if (_linkName != null) {
- return createPageAnchor(results, request, trb);
+ return createPageAnchor(request, trb);
}
// report that action is not an action
if ((_action != null) && (!PageflowTagUtils.isAction(request, response, ctxt, _action))) {
String s = null;
if (_action.equals("")) {
- s = Bundle.getString("Tags_NullBadAction", null);
+ s = Bundle.getString("Tags_NullBadAction", null);
}
else {
s = Bundle.getString("Tags_BadAction", _action);
@@ -717,9 +635,9 @@
if (_action != null) {
// simply set this to the result of mangling the action
- String qualifiedAction = PageflowTagUtils.qualifiedAction(ctxt,_action);
+ String qualifiedAction = PageflowTagUtils.qualifiedAction(ctxt, _action);
String actionUrl = PageflowTagUtils.createActionPath(request, qualifiedAction);
- if(URLRewriterService.needsSecure(request, ctxt, actionUrl, false))
+ if (URLRewriterService.needsSecure(request, ctxt, actionUrl, false))
type = URLRewriter.ACTION_SECURE;
internalHref = PageflowTagUtils.createActionURL(request, qualifiedAction);
}
@@ -806,7 +724,11 @@
_form.generateRealName();
}
- trb.doStartTag(results, _state);
+ if (hasErrors())
+ return false;
+
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ trb.doStartTag(writer, _state);
//Emit javascript if this anchor needs to sumbit the form
if (_formSubmit && formAction != null) {
@@ -818,23 +740,23 @@
script.append(idScript);
// create the javaScript
- return !hasErrors();
+ return true;
}
/**
- * @param results
* @param tagId
* @return
*/
- private boolean createNameAnchor(StringBuilder results, ServletRequest req, String tagId, TagRenderingBase trb)
+ private boolean createNameAnchor(ServletRequest req, String tagId, TagRenderingBase trb)
{
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
_state.name = tagId;
trb = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, req);
- trb.doStartTag(results, _state);
+ trb.doStartTag(writer, _state);
return !hasErrors();
}
- private boolean createPageAnchor(StringBuilder results, ServletRequest req, TagRenderingBase trb)
+ private boolean createPageAnchor(ServletRequest req, TagRenderingBase trb)
{
_linkName = _linkName.trim();
if (_linkName.charAt(0) != '#') {
@@ -843,8 +765,9 @@
else
_state.href = _linkName;
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
trb = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, req);
- trb.doStartTag(results, _state);
+ trb.doStartTag(writer, _state);
return !hasErrors();
}
@@ -886,7 +809,7 @@
logger.error(Bundle.getString("Tags_MalformedURLException"));
String s = null;
s = Bundle.getString("Tags_Anchor_URLException",
- new Object[] {e.getMessage()});
+ new Object[]{e.getMessage()});
registerTagError(s, e);
}
return url;
@@ -922,16 +845,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
- * H, V, left arrow, and right arrow</code>
- *
+ * are often used by browsers: <code>A, C, E, F, G,
+ * H, V, left arrow, and right arrow</code>
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description=" The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -949,13 +868,9 @@
/**
* Sets the onBlur javascript event.
* @param onblur - the onBlur event.
- * @jsptagref.attributedescription
- * The onBlur JavaScript event.
- *
+ * @jsptagref.attributedescription The onBlur JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onBlur</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onBlur JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -968,13 +883,9 @@
/**
* Sets the onFocus javascript event.
* @param onfocus - the onFocus event.
- * @jsptagref.attributedescription
- * The onFocus JavaScript event.
- *
+ * @jsptagref.attributedescription The onFocus JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onFocus</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onFocus JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java Thu Nov 4 07:35:11 2004
@@ -26,26 +26,24 @@
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
- * @jsptagref.tagdescription
- * <p>Adds an attribute to the parent tag rendered in the browser.</p>
- *
- * <p>The following <netui:attribute> tags are rendered within the <span> tag (since
+ * @jsptagref.tagdescription <p>Adds an attribute to the parent tag rendered in the browser.</p>
+ *
+ * <p>The following <netui:attribute> tags are rendered within the <span> tag (since
* the <netui:label> tag is rendered as a <span> tag in the browser.
- *
+ *
* <pre> <netui:label value="Some Text">
* <netui:attribute name="a" value="aVal" />
* <netui:attribute name="b" value="bVal" />
* <netui:attribute name="c" value="cVal" />
* </netui:label></pre>
- *
+ *
* <p>The HTML rendered in the browser appears as follows.
- *
+ *
* <pre> <span a="aVal" b="bVal" c="cVal">Some Text</span></pre>
- *
+ *
* Note that the <code>value</code> attribute can be dynamically determined using a databinding expression.
- *
+ *
* <pre> <netui:attribute name="a" value="{pageFlow.aAttributeValue}" /></pre>
- *
* @netui:tag name="attribute" body-content="empty" description="Add an attribute to the parent tag which be rendered."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.AttributeRenderer"
* bodycontentpref="empty" whitespace="indent"
@@ -68,40 +66,32 @@
/**
* Sets the <code>name</code> attribute.
* @param name - the value of the <code>name</code> attribute.
- * @jsptagref.attributedescription
- * The name of the attribute to add to the parent tag.
- *
+ * @jsptagref.attributedescription The name of the attribute to add to the parent tag.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_name</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The name of the attribute to add to the parent tag."
* @netui.tldx:attribute
*/
public void setName(String name)
- throws JspException
+ throws JspException
{
- _name = setRequiredValueAttribute(name,"name");
+ _name = setRequiredValueAttribute(name, "name");
}
/**
* Sets the <code>value</code> attribute.
* @param value - the value of the <code>name</code> attribute.
- * @jsptagref.attributedescription
- * The value of the attribute to add to the parent tag.
- *
+ * @jsptagref.attributedescription The value of the attribute to add to the parent tag.
* @jsptagref.databindable true
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_value</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The value of the attribute to add to the parent tag."
* @netui.tldx:attribute
*/
public void setValue(String value)
{
- _value = setNonEmptyValueAttribute(value);
+ _value = setNonEmptyValueAttribute(value);
}
/**
@@ -112,9 +102,9 @@
* @netui.tldx:attribute
*/
public void setFacet(String facet)
- throws JspException
+ throws JspException
{
- _facet = setRequiredValueAttribute(facet,"facet");
+ _facet = setRequiredValueAttribute(facet, "facet");
}
/**
@@ -122,14 +112,14 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
if (hasErrors()) {
reportErrors();
return;
}
- JspTag tag = SimpleTagSupport.findAncestorWithClass(this,IAttributeConsumer.class);
+ JspTag tag = SimpleTagSupport.findAncestorWithClass(this, IAttributeConsumer.class);
if (!(tag instanceof IAttributeConsumer)) {
String s = Bundle.getString("Tags_AttributeInvalidParent");
registerTagError(s, null);
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java Thu Nov 4 07:35:11 2004
@@ -24,6 +24,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractAttributeState;
import org.apache.beehive.netui.tags.rendering.BaseTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.http.HttpServletRequest;
@@ -33,10 +34,7 @@
/**
* Provides the base for every URL on this page.
- *
- * @jsptagref.tagdescription
- * Provides the base for every URL on the page.
- *
+ * @jsptagref.tagdescription Provides the base for every URL on the page.
* @example In this sample, the Base tag is simply dropped in and then automatically determines
* the base for each URL on this page.
* <pre>
@@ -44,7 +42,6 @@
* <netui:base />
* </head>
* </pre>
- *
* @netui:tag name="base" body-content="scriptless" description="Provides the base for every URL on this page."
* @netui.tldx:tag requiredchild="attribute" renderer="workshop.netui.jspdesigner.tldx.BaseRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -64,13 +61,9 @@
/**
* Set the default window target.
* @param target - the window target.
- * @jsptagref.attributedescription
- * The default window target.
- *
+ * @jsptagref.attributedescription The default window target.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_windowTarget</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The default window target."
*/
@@ -129,7 +122,7 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException, IOException
+ throws JspException, IOException
{
PageContext pageContext = getPageContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
@@ -161,9 +154,9 @@
buf.setLength(0);
// render the tag.
- br.doStartTag(buf, _state);
- br.doEndTag(buf);
- write(buf.toString());
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ br.doStartTag(writer, _state);
+ br.doEndTag(writer);
// This will produce invalid HTML/XHTML if there are errors
// because we are going to put markup out into the head.
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java Thu Nov 4 07:35:11 2004
@@ -19,8 +19,8 @@
import org.apache.beehive.netui.pageflow.ServerAdapter;
import org.apache.beehive.netui.pageflow.internal.BindingUpdateError;
-import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.pageflow.internal.ContextCache;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.Bundle;
@@ -79,9 +79,9 @@
* Otherwise, all errors will be displayed."
*/
public void setExpression(String expression)
- throws JspException
+ throws JspException
{
- _expression = setRequiredValueAttribute(expression,"expression");
+ _expression = setRequiredValueAttribute(expression, "expression");
}
/**
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java Thu Nov 4 07:35:11 2004
@@ -17,21 +17,20 @@
*/
package org.apache.beehive.netui.tags.html;
-import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.ErrorHandling;
+import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.BodyTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.jsp.JspException;
/**
- * @jsptagref.tagdescription
- * <p>
+ * @jsptagref.tagdescription <p>
* Renders an HTML <body> tag with the attributes specified.
* </p>
- *
* @netui:tag name="body" description="Output the <body> container. This tag allows the NetUI framework to output script and errors before the page is finished rendering."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.BodyRenderer" whitespace="indent"
*/
@@ -61,14 +60,9 @@
/**
* Sets the onLoad javascript event.
* @param onload - the onLoad event.
- *
- * @jsptagref.attributedescription
- * The onLoad JavaScript event.
- *
+ * @jsptagref.attributedescription The onLoad JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onLoad</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onLoad JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -81,14 +75,9 @@
/**
* Sets the onUnload javascript event.
* @param onunload - the onUnload event.
- *
- * @jsptagref.attributedescription
- * The onLoad JavaScript event.
- *
+ * @jsptagref.attributedescription The onLoad JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onUnload</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onLoad JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -101,13 +90,9 @@
/**
* Sets the background image of the page.
* @param background - the background image of the page.
- * @jsptagref.attributedescription
- * The background image of the page.
- *
+ * @jsptagref.attributedescription The background image of the page.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_background</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The background image of the page."
* @netui.tldx:attribute category="misc"
@@ -120,13 +105,9 @@
/**
* Sets the bgcolor of the page.
* @param bgcolor - the background color of the page.
- * @jsptagref.attributedescription
- * The background color of the page.
- *
+ * @jsptagref.attributedescription The background color of the page.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_bgcolor</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The background color of the page."
* @netui.tldx:attribute category="misc"
@@ -139,13 +120,9 @@
/**
* Sets the foreground text color of the page.
* @param text - the foreground text color of the page.
- * @jsptagref.attributedescription
- * The foreground text color of the page.
- *
+ * @jsptagref.attributedescription The foreground text color of the page.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_text</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The foreground text color of the page."
* @netui.tldx:attribute category="misc"
@@ -158,13 +135,9 @@
/**
* Sets the the color of text marking unvisited hypertext links.
* @param link - the color of text marking unvisited hypertext links of the page.
- * @jsptagref.attributedescription
- * The color of text marking unvisited hypertext links of the page
- *
+ * @jsptagref.attributedescription The color of text marking unvisited hypertext links of the page
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_link</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The color of text marking unvisited hypertext links of the page."
* @netui.tldx:attribute category="misc"
@@ -177,13 +150,9 @@
/**
* Sets the the color of text marking visited hypertext links.
* @param vlink - the color of text marking visited hypertext links of the page.
- * @jsptagref.attributedescription
- * The color of text marking visited hypertext links of the page
- *
+ * @jsptagref.attributedescription The color of text marking visited hypertext links of the page
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_vlink</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The color of text marking visited hypertext links of the page."
* @netui.tldx:attribute category="misc"
@@ -196,13 +165,9 @@
/**
* Sets the color of text marking hypertext links when selected by the user.
* @param alink - the color of text marking hypertext links when selected by the user.
- * @jsptagref.attributedescription
- * The color of text marking hypertext links when selected by the user
- *
+ * @jsptagref.attributedescription The color of text marking hypertext links when selected by the user
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_alink</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The color of text marking hypertext links when selected by the user."
* @netui.tldx:attribute category="misc"
@@ -218,13 +183,13 @@
*/
public int doStartTag() throws JspException
{
- StringBuilder results = new StringBuilder(32);
+ //StringBuilder results = new StringBuilder(32);
// render the header...
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
_br = TagRenderingBase.Factory.getRendering(TagRenderingBase.BODY_TAG,
pageContext.getRequest());
- _br.doStartTag(results, _state);
- write(results.toString());
+ _br.doStartTag(writer, _state);
return EVAL_BODY_INCLUDE;
}
@@ -235,7 +200,7 @@
*/
public int doEndTag() throws JspException
{
- StringBuilder results = new StringBuilder(64);
+ //StringBuilder results = new StringBuilder(64);
// render the header...
@@ -252,16 +217,17 @@
}
// write out any errors
- ErrorHandling.reportCollectedErrors(results,this);
+ ErrorHandling.reportCollectedErrors(pageContext, this);
// write out the script before the end tag.
if (sr.isInitScriptWritten()) {
- sr.writeScript(results);
+ sr.writeScript(pageContext);
}
}
- _br.doEndTag(results);
- write(results.toString());
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ _br.doEndTag(writer);
+ //write(results.toString());
// Evaluate the remainder of this page
localRelease();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java Thu Nov 4 07:35:11 2004
@@ -24,6 +24,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.InputSubmitTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
@@ -38,21 +39,15 @@
* <netui:button> tag must be enclosed in <netui:form...> ...
* </netui:form> tags. You can specify the action that the form will
* raise on the <netui:form> tag.
- *
- *
-
- * @jsptagref.tagdescription
- * Renders an HTML button with the specified attributes. To
- * submit data or invoke a method on the Controller file, the
- * <netui:button> tag must a parent {@link Form} tag.
- * The action attribute on the <netui:button> is for the purpose
- * of overriding the action attribute on the enclosing <netui:form> tag.
- * If no action attribute is specified on the <netui:button> tag,
+ * @jsptagref.tagdescription Renders an HTML button with the specified attributes. To
+ * submit data or invoke a method on the Controller file, the
+ * <netui:button> tag must a parent {@link Form} tag.
+ * The action attribute on the <netui:button> is for the purpose
+ * of overriding the action attribute on the enclosing <netui:form> tag.
+ * If no action attribute is specified on the <netui:button> tag,
* the action attribute
* on the <netui:form> tag will determine which action method is invoked.
- *
- * @example
- * In this sample, the <netui:button> submits data to
+ * @example In this sample, the <netui:button> submits data to
* the Controller file's <code>processData</code> action method (specified on the <netui:form>'s action
* attribute).
* <pre>
@@ -61,8 +56,7 @@
* input elements here
* -->
* <netui:button value="Submit" type="submit"/>
- * </netui:form></pre>
- *
+ * </netui:form></pre>
* @netui:tag name="button" description="Create a button on your JSP page."
* @netui.tldx:tag requiredchild="parameter parameterMap, attribute" renderer="workshop.netui.jspdesigner.tldx.ButtonRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -117,46 +111,38 @@
/**
* Set the name of the action for the Button.
* @param action - the name of the action to set for the Button.
- * @jsptagref.attributedescription
- * The action method invoked. The value of this attribute will override
+ * @jsptagref.attributedescription The action method invoked. The value of this attribute will override
* the <code>action</code>
* attribute of the parent <netui:form> tag.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_action</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The action method invoked. The value of this attribute will override
* the action attribute of the parent <netui:form> tag."
* @netui.tldx:attribute reftype="netui-action-url"
*/
public void setAction(String action)
- throws JspException
+ throws JspException
{
- _action = setRequiredValueAttribute(action,"action");
+ _action = setRequiredValueAttribute(action, "action");
}
/**
* Set the type of the Button (submit, button, or reset).
* @param type - the type of the Button.
- * @jsptagref.attributedescription
- * The type of the button. Possible values are <code>submit</code>, <code>button</code>, or <code>reset</code>.
+ * @jsptagref.attributedescription The type of the button. Possible values are <code>submit</code>, <code>button</code>, or <code>reset</code>.
* The default value is <code>submit</code>.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_type</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The type of the button. Possible values are submit, button, or reset.
* The default value is submit."
*/
public void setType(String type)
- throws JspException
+ throws JspException
{
- if (INPUT_SUBMIT.equals(type) || INPUT_BUTTON.equals(type) || INPUT_RESET.equals(type)) {
- _state.type = type;
+ if (INPUT_SUBMIT.equals(type) || INPUT_BUTTON.equals(type) || INPUT_RESET.equals(type)) {
+ _state.type = type;
return;
}
String s = Bundle.getString("Tags_ButtonTypeError", new Object[]{type});
@@ -166,13 +152,9 @@
/**
* Set the value of the Button's text.
* @param value - the value of the Button's text.
- * @jsptagref.attributedescription
- * The text displayed by the rendered HTML button.
- *
+ * @jsptagref.attributedescription The text displayed by the rendered HTML button.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_value</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The text displayed by the rendered HTML button."
* @netui.tldx:attribute
@@ -244,7 +226,7 @@
_state.value = _value;
// Generate an HTML element
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
_state.disabled = isDisabled();
if (_action != null) {
@@ -275,13 +257,14 @@
if (hasErrors())
return reportAndExit(EVAL_PAGE);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_SUBMIT_TAG, request);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
// Evaluate the remainder of this page
localRelease();
@@ -314,16 +297,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -341,13 +320,9 @@
/**
* Sets the alt attribute value.
* @param alt - the alt value.
- * @jsptagref.attributedescription
- * The alt attribute of the element.
- *
+ * @jsptagref.attributedescription The alt attribute of the element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alt attribute of the element."
* @netui.tldx:attribute category="misc"
@@ -360,14 +335,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBox.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBox.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBox.java Thu Nov 4 07:35:11 2004
@@ -23,10 +23,7 @@
import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor;
import org.apache.beehive.netui.tags.naming.IndexedNameInterceptor;
import org.apache.beehive.netui.tags.naming.PrefixNameInterceptor;
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
-import org.apache.beehive.netui.tags.rendering.InputBooleanTag;
-import org.apache.beehive.netui.tags.rendering.InputHiddenTag;
-import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
@@ -44,35 +41,31 @@
* body content.
*
* CheckBoxes can bind to boolean, Boolean, and Strings.
- *
- * @jsptagref.tagdescription
- * <p>Generates a single HTML checkbox. The <netui:checkBox> tag should be used on its own, not within a
+ * @jsptagref.tagdescription <p>Generates a single HTML checkbox. The <netui:checkBox> tag should be used on its own, not within a
* {@link CheckBoxGroup}.
*
* <p>The <netui:checkBox> tag can be data bound to a boolean or Boolean type. For instance,
* the following <netui:checkBox> tag...
- *
+ *
* <pre> <netui:checkBox dataSource="{actionForm.checkBoxValue}"/></pre>
- *
+ *
* ...must be bound to a boolean or Boolean field in the Form Bean...
- *
+ *
* <pre> public static class ProcessDataForm extends FormData
* {
* private boolean checkBoxValue;
- *
+ *
* public void setCheckBoxValue(boolean checkBoxValue)
* {
* this.checkBoxValue = checkBoxValue;
* }
- *
+ *
* public boolean isCheckBoxValue()
* {
* return this.checkBoxValue;
* }
* }</pre>
- *
- * @example
- * In this sample, the <netui:checkBox reads it initial value from the
+ * @example In this sample, the <netui:checkBox reads it initial value from the
* Form Bean field <code>wantSpecialOffers</code>. Upon submission, the user specified value is
* loaded into the same Form Bean field. The data is submitted to the
* action method <code>processData</code>.
@@ -81,8 +74,6 @@
* <netui:checkBox dataSource="{actionForm.wantsSpecialOffers}"/><br>
* <netui:button value="Submit" type="submit"/>
* </netui:form></pre>
- *
- *
* @netui:tag name="checkBox" description="Generates a checkbox that binds to a form bean property or databound expression."
* @netui.tldx:tag requiredchild="attribute" renderer="workshop.netui.jspdesigner.tldx.CheckboxRenderer"
* bodycontentpref="empty" whitespace="indent"
@@ -223,7 +214,6 @@
* @return A boolean value.
*/
private boolean evaluateDefaultValue()
- throws JspException
{
if (_defaultValue instanceof String)
return Boolean.valueOf((String) _defaultValue).booleanValue();
@@ -265,12 +255,12 @@
Object val = evaluateDataSource();
if (hasErrors()) {
- return reportAndExit(EVAL_PAGE);
+ return reportAndExit(EVAL_PAGE);
}
-
+
String realName = doNaming();
if (hasErrors()) {
- return reportAndExit(EVAL_PAGE);
+ return reportAndExit(EVAL_PAGE);
}
String hiddenParamName = realName + OLDVALUE_SUFFIX;
@@ -297,11 +287,11 @@
}
_state.disabled = isDisabled();
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
idScript = renderTagId(_state, realName, false, true);
//Create a hidden field to store the CheckBox oldValue
- String oldValue = pageContext.getRequest().getParameter(realName);
+ String oldValue = req.getParameter(realName);
// if the checkbox is disabled we need to not right out the hidden
// field because it can cause the default state to change from
@@ -314,9 +304,10 @@
else {
_hiddenState.value = oldValue;
}
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
- hiddenTag.doStartTag(results, _hiddenState);
- hiddenTag.doEndTag(results);
+ hiddenTag.doStartTag(writer, _hiddenState);
+ hiddenTag.doEndTag(writer);
}
_state.type = INPUT_CHECKBOX;
@@ -324,13 +315,14 @@
if (_dataSource != null)
_state.name = realName;
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
// Continue processing this page
localRelease();
@@ -361,16 +353,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
* are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -388,13 +376,9 @@
/**
* Sets the alt attribute value.
* @param alt - the alt value.
- * @jsptagref.attributedescription
- * The alt attribute of the element.
- *
+ * @jsptagref.attributedescription The alt attribute of the element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alt attribute of the element."
* @netui.tldx:attribute category="misc"
@@ -407,14 +391,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java Thu Nov 4 07:35:11 2004
@@ -22,8 +22,7 @@
import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor;
import org.apache.beehive.netui.tags.naming.IndexedNameInterceptor;
import org.apache.beehive.netui.tags.naming.PrefixNameInterceptor;
-import org.apache.beehive.netui.tags.rendering.InputHiddenTag;
-import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.iterator.IteratorFactory;
import org.apache.beehive.netui.util.iterator.IteratorFactoryException;
@@ -42,81 +41,77 @@
*
* If CheckBoxGroup uses any Format tags, it must have those tags come before any nested
* CheckBoxOption tags.
+ * @jsptagref.tagdescription Handles data binding for a collection of checkboxes.
*
- * @jsptagref.tagdescription
- * Handles data binding for a collection of checkboxes.
- *
* <p><b>Submitting Data</b></p>
* <p>The <netui:checkBoxGroup> submits data in the form of a String[] object.
* For example, if the <netui:checkBoxGroup> submits data to a Form Bean field...
- *
- * <pre> <netui:checkBoxGroup
+ *
+ * <pre> <netui:checkBoxGroup
* dataSource="{actionForm.userSelections}"
* optionsDataSource="{pageFlow.availableSelections}" /></pre>
- *
- * ...then the Form Bean field must be a String[] object...
- *
+ *
+ * ...then the Form Bean field must be a String[] object...
+ *
* <pre> public static class SubmitForm extends FormData
* {
* private String[] userSelections;
- *
+ *
* public void setUserSelections(String[] userSelections)
* {
* this.userSelections = userSelections;
* }
- *
+ *
* public String[] getUserSelections()
* {
* return this.userSelections;
* }
* }</pre>
- *
+ *
* <p><b>Dynamically Defined Checkboxes</b></p>
* You can dynamically define a set of checkboxes by pointing the <code>optionsDataSource</code> attribute
- * at a String[] object. When the <netui:checkBoxGroup> is rendered in the browser, a
- * corresponding set of
+ * at a String[] object. When the <netui:checkBoxGroup> is rendered in the browser, a
+ * corresponding set of
* checkboxes will be genereated from the String[] object.
- *
+ *
* <p>For example, if you define a String[] object in the Controller file...
- *
+ *
* <pre> public String[] availableOptions = {"option1", "option2", "option3"};</pre>
- *
+ *
* ...and reference this String[] from the <code>optionDataSource</code> attribute...
- *
- * <pre> <netui:checkBoxGroup
+ *
+ * <pre> <netui:checkBoxGroup
* dataSource="{actionForm.userSelections}"
* optionsDataSource="{pageFlow.availableSelections}" /></pre>
- *
+ *
* ...then the appropriate checkboxes will be rendered in the browser.
- *
+ *
* <pre> <input type="checkbox" value="option1">option1</input>
* <input type="checkbox" value="option2">option2</input>
- * <input type="checkbox" value="option3">option3</input></pre>
- *
- * For checkboxes to be rendered, either the <code>optionsDataSource</code> attribute must be provided
- * (and point to a String[] object) or the <netui:checkBoxGroup> must have children
+ * <input type="checkbox" value="option3">option3</input></pre>
+ *
+ * For checkboxes to be rendered, either the <code>optionsDataSource</code> attribute must be provided
+ * (and point to a String[] object) or the <netui:checkBoxGroup> must have children
* <netuiCheckBoxOption> tags.
- *
+ *
* <p><b>Setting Default Options</b></p>
- * <p>The <code>defaultValue</code> attribute can be used to determine which checkboxs are checked
- * when they are first rendered in the browser. The <code>defaultValue</code> attribute
- * should point to a String, if only one checkbox should appear checked, or to a String[] object,
- * if multiple checkboxes should appear checked.
- *
- * @example
- * In this first sample, the <netui:checkBoxGroup>
+ * <p>The <code>defaultValue</code> attribute can be used to determine which checkboxs are checked
+ * when they are first rendered in the browser. The <code>defaultValue</code> attribute
+ * should point to a String, if only one checkbox should appear checked, or to a String[] object,
+ * if multiple checkboxes should appear checked.
+ * @example In this first sample, the <netui:checkBoxGroup>
* submits data to the Form Bean field <code>preferredColors</code>.
- *
- * <pre> <netui:checkBoxGroup
+ *
+ * <pre> <netui:checkBoxGroup
* dataSource="{actionForm.preferredColors}"
* optionsDataSource="{pageFlow.colors}" /></pre>
- *
+ *
* The <code>optionsDataSource</code> attribute points to a String[] on the Controller file:
- *
+ *
* <pre> colors = new String[] {"Red", "Blue", "Green", "Yellow", "White", "Black"};</pre>
- *
+ *
* This automatically renders the appropriate set of checkbox options within the <checkBoxGroup>:
- *
+ *
* <pre> <input type="checkbox" value="Red">Red</input>
* <input type="checkbox" value="Blue">Blue</input>
* <input type="checkbox" value="Green">Green</input>
@@ -125,20 +120,19 @@
* <input type="checkbox" value="Black">Black</input></pre>
*
* The <code>defaultValue</code> attribute may point to a String or a String[].
- *
+ *
* <pre> defaultValue = new String ("Blue");</pre>
* <pre> defaultValue = new String[] {"Red", "Blue"};</pre>
- *
- * In either case, the appropriate
+ *
+ * In either case, the appropriate
* checkbox options will appear checked in the browser.
- *
+ *
* <pre> <input type="checkbox" value="Red" checked="true">Red</input>
* <input type="checkbox" value="Blue" checked="true">Blue</input>
* <input type="checkbox" value="Green">Green</input>
* <input type="checkbox" value="Yellow">Yellow</input>
* <input type="checkbox" value="White">White</input>
- * <input type="checkbox" value="Black">Black</input></pre>
- *
+ * <input type="checkbox" value="Black">Black</input></pre>
* @netui:tag name="checkBoxGroup" description="Groups a collection of CheckBoxOptions, and handles databinding of their values."
* @netui.tldx:tag whitespace="indent"
* renderer="workshop.netui.jspdesigner.tldx.CheckboxGroupRenderer"
@@ -343,8 +337,9 @@
// if the checkbox group is disabled do not write out the
// hidden field.
- StringBuilder results = new StringBuilder(64);
- if (!_repeater && !_disabled) {
+ //StringBuilder results = new StringBuilder(64);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ if (!_repeater && !_disabled) {
//Create hidden field for state tracking
_state.clear();
@@ -354,12 +349,12 @@
_state.value = "true";
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
- hiddenTag.doStartTag(results, _state);
- hiddenTag.doEndTag(results);
+ hiddenTag.doStartTag(writer, _state);
+ hiddenTag.doEndTag(writer);
}
if (isVertical())
- _cr.TABLE(results);
+ _cr.TABLE(writer);
// if this is a repeater then we shouid prime the pump...
_dynamicAttrs = evaluateOptionsDataSource();
@@ -379,14 +374,14 @@
break;
}
if (isVertical())
- _cr.TR_TD(results);
+ _cr.TR_TD(writer);
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
}
_saveBody = new StringBuilder(128);
// Continue processing this page
- write(results.toString());
+ //write(results.toString());
return EVAL_BODY_BUFFERED;
}
@@ -398,6 +393,7 @@
*/
public int doAfterBody() throws JspException
{
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(_saveBody);
if (bodyContent != null) {
String value = bodyContent.getString();
bodyContent.clearBody();
@@ -409,17 +405,17 @@
if (_repeater) {
ServletRequest req = pageContext.getRequest();
if (_cr == null)
- _cr = TagRenderingBase.Factory.getConstantRendering(req);
+ _cr = TagRenderingBase.Factory.getConstantRendering(req);
if (isVertical())
- _cr.end_TD_TR(_saveBody);
+ _cr.end_TD_TR(writer);
while (((Iterator) _dynamicAttrs).hasNext()) {
_repCurItem = ((Iterator) _dynamicAttrs).next();
if (_repCurItem != null) {
_repIdx++;
if (isVertical())
- _cr.TR_TD(_saveBody);
+ _cr.TR_TD(writer);
return EVAL_BODY_AGAIN;
}
@@ -440,7 +436,7 @@
return reportAndExit(EVAL_PAGE);
ServletRequest req = pageContext.getRequest();
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
@@ -451,18 +447,19 @@
// Render a tag representing the end of our current form
if (_saveBody != null)
- results.append(_saveBody);
+ write(_saveBody.toString());
// if this is a repeater then we have created the content in the body so we write that
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (_repeater) {
// Render a tag representing the end of our current form
if (isVertical())
- _cr.end_TABLE(results);
+ _cr.end_TABLE(writer);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -478,18 +475,18 @@
String optionDisplay = "";
if (dynamicCheckboxesMap.get(optionValue) != null)
optionDisplay = dynamicCheckboxesMap.get(optionValue).toString();
- addOption(results, INPUT_CHECKBOX, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
+ addOption(writer, INPUT_CHECKBOX, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
if (hasErrors()) {
reportErrors();
if (isVertical()) {
- _cr.end_TABLE(results);
- write(results.toString());
+ _cr.end_TABLE(writer);
+ //write(results.toString());
}
localRelease();
return EVAL_PAGE;
}
- results.append("\n");
+ write("\n");
}
}
else {
@@ -503,38 +500,38 @@
if (o instanceof GroupOption) {
GroupOption go = (GroupOption) o;
- addOption(results, INPUT_CHECKBOX, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
+ addOption(writer, INPUT_CHECKBOX, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
}
else {
String checkboxValue = o.toString();
- addOption(results, INPUT_CHECKBOX, checkboxValue, checkboxValue, idx++, altText, accessKey, _disabled);
+ addOption(writer, INPUT_CHECKBOX, checkboxValue, checkboxValue, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
if (isVertical()) {
- _cr.end_TABLE(results);
- write(results.toString());
+ _cr.end_TABLE(writer);
+ //write(results.toString());
}
localRelease();
return EVAL_PAGE;
}
- results.append("\n");
+ write("\n");
}
}
if (isVertical())
- _cr.end_TABLE(results);
+ _cr.end_TABLE(writer);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
- public void createHiddenField(StringBuilder results)
+ public void createHiddenField(AbstractRenderAppender results)
throws JspException
{
if (_repIdx == 0 && !_disabled) {
@@ -560,7 +557,7 @@
protected void localRelease()
{
// cleanup the context variables used for binding during repeater
- if(_repeater)
+ if (_repeater)
DataAccessProviderStack.removeDataAccessProvider(pageContext);
super.localRelease();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java Thu Nov 4 07:35:11 2004
@@ -31,19 +31,14 @@
/**
* A checkbox whose state is determined by its enclosing CheckBoxGroup.
+ * @jsptagref.tagdescription Renders a single HTML checkbox within a group of checkboxes.
*
-
- * @jsptagref.tagdescription
- * Renders a single HTML checkbox within a group of checkboxes.
- *
- * The <netui:checkBoxOption> tags must have a parent
+ * The <netui:checkBoxOption> tags must have a parent
* {@link CheckBoxGroup} tag (which
* determines the data binding for the <netui:checkBoxOption> tags).
- *
- * @example
- * In this sample, a set of <checkBoxOption> tags are submitted
- * to the <code>processData</code> action method.
- *
+ * @example In this sample, a set of <checkBoxOption> tags are submitted
+ * to the <code>processData</code> action method.
+ *
* <pre> <netui:form action="processData">
* <netui:checkBoxGroup dataSource="{actionForm.data}" defaultValue="{actionForm.defaultChoices}">
* <netui:checkBoxOption value="wantSpecialCDOffers">Do you want to be notified of special CD offers?</netui:checkBoxOption><br>
@@ -51,8 +46,6 @@
* </netui:checkBoxGroup>
* <netui:button value="Submit" type="submit"/>
* </netui:form></pre>
- *
- *
* @netui:tag name="checkBoxOption" description="A checkbox whose state is determined by its enclosing CheckBoxGroup."
* @netui.tldx:tag requiredparent="checkBoxGroup"
* whitespace="indent"
@@ -114,13 +107,9 @@
* Set the label style for each contained CheckBoxOption.
* The label style here will override a labelStyle at the CheckBoxGroup level.
* @param labelStyle - the label style
- * @jsptagref.attributedescription
- * The style of the text displayed by the rendered checkbox.
- *
+ * @jsptagref.attributedescription The style of the text displayed by the rendered checkbox.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_label</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The style of the text displayed by the rendered checkbox."
* @netui.tldx:attribute category="format" propertyclass="workshop.jspdesigner.properties.JspStyleProperty"
@@ -134,13 +123,9 @@
* Set the label style class for each contained CheckBoxOption.
* The label style class here will override a labelStyleClass at the CheckBoxGroup level.
* @param labelStyleClass - the label style
- * @jsptagref.attributedescription
- * The class of the text displayed by the rendered checkbox.
- *
+ * @jsptagref.attributedescription The class of the text displayed by the rendered checkbox.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_class</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The class of the text displayed by the rendered checkbox."
* @netui.tldx:attribute category="format"
@@ -153,14 +138,10 @@
/**
* Set the value of this CheckBoxOption.
* @param value - the CheckBoxOption value
- * @jsptagref.attributedescription
- * A String literal or a data binding expression. The value attribute determines the value submitted
+ * @jsptagref.attributedescription A String literal or a data binding expression. The value attribute determines the value submitted
* by the checkbox.
- *
* @jsptagref.databindable true
- *
* @jsptagref.attributesyntaxvalue <i>string_literal_or_expression_value</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="A String literal or a data binding expression. The value attribute determines the value submitted
* by the checkbox."
@@ -232,9 +213,10 @@
boolean repeat = parent.isRepeater();
// StringBuilder for the results
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (!repeat && parent.isVertical()) {
- cr.TR_TD(results);
+ cr.TR_TD(writer);
}
_state.type = INPUT_CHECKBOX;
@@ -251,16 +233,16 @@
_state.disabled = parent.isDisabled();
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
- br.doStartTag(results, _state);
- br.doEndTag(results);
+ br.doStartTag(writer, _state);
+ br.doEndTag(writer);
- if (repeat &&! parent.isDisabled()) {
- parent.createHiddenField(results);
+ if (repeat && !parent.isDisabled()) {
+ parent.createHiddenField(writer);
}
// if this is in a repeater, then we only output the <input tag>
if (repeat) {
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -273,17 +255,17 @@
}
TagRenderingBase spanTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
- spanTag.doStartTag(results, _spanState);
+ spanTag.doStartTag(writer, _spanState);
if (_text == null)
- results.append(_state.value);
+ write(_state.value);
else
- results.append(_text);
- spanTag.doEndTag(results);
+ write(_text);
+ spanTag.doEndTag(writer);
if (parent.isVertical()) {
- cr.end_TD_TR(results);
+ cr.end_TD_TR(writer);
}
- write(results.toString());
+ //write(results.toString());
// Continue evaluating this page
localRelease();
@@ -316,16 +298,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -341,13 +319,9 @@
/**
* Sets the alt attribute value.
* @param alt - the alt value.
- * @jsptagref.attributedescription
- * The alt attribute of the element.
- *
+ * @jsptagref.attributedescription The alt attribute of the element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alt attribute of the element."
* @netui.tldx:attribute category="misc"
@@ -360,14 +334,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Content.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Content.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Content.java Thu Nov 4 07:35:11 2004
@@ -17,7 +17,6 @@
*/
package org.apache.beehive.netui.tags.html;
-import org.apache.beehive.netui.tags.AbstractClassicTag;
import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
@@ -26,46 +25,40 @@
/**
* The Content tag is used to display text, or the result of an expression, to the page.
- *
-
- * @jsptagref.tagdescription
- * Displays text or the result of an expression.
+ * @jsptagref.tagdescription Displays text or the result of an expression.
* Note that <netui:content> is similar to {@link Label}, except for the way
- * it processes HTML-sensitive text. The <netui:content> tag does not escape
- * HTML-sensitive characters, but the <netui:label> tag filters the input
+ * it processes HTML-sensitive text. The <netui:content> tag does not escape
+ * HTML-sensitive characters, but the <netui:label> tag filters the input
* string for characters that are senstive to
- * HTML interpreters and replaces these characters
- * with the corresponding entity strings. For example, if you pass the
+ * HTML interpreters and replaces these characters
+ * with the corresponding entity strings. For example, if you pass the
* string '&amp;' to a <netui:label> tag, the string '&amp;amp;' will be written to
* the HTML source file, and the following will be displayed
* in the browser: '&amp;'.
- *
+ *
* <p>The following table shows how the <netui:label> and <netui:content> tags treat HTML-sensitive characters.
* <blockquote>
- * <table border="1">
- * <tr>
- * <td width="30%"><b>tag</b></td>
- * <td width="30%"><b>generated HTML source</b></td>
- * <td width="30%"><b>displayed in browser</b></td>
- * </tr>
- * <tr>
- * <td><netui:content value="&amp;"/></td>
- * <td>&amp;</td>
- * <td>&</td>
- * </tr>
- * <tr>
- * <td><netui:label value="&amp;"/></td>
- * <td>&amp;amp;</td>
- * <td>&amp;</td>
- * </tr>
- * </table>
+ * <table border="1">
+ * <tr>
+ * <td width="30%"><b>tag</b></td>
+ * <td width="30%"><b>generated HTML source</b></td>
+ * <td width="30%"><b>displayed in browser</b></td>
+ * </tr>
+ * <tr>
+ * <td><netui:content value="&amp;"/></td>
+ * <td>&amp;</td>
+ * <td>&</td>
+ * </tr>
+ * <tr>
+ * <td><netui:label value="&amp;"/></td>
+ * <td>&amp;amp;</td>
+ * <td>&amp;</td>
+ * </tr>
+ * </table>
* </blockquote>
- *
- * @example
- * In this sample, the Content tag displays the Form Bean's <code>lastName</code> property.
+ * @example In this sample, the Content tag displays the Form Bean's <code>lastName</code> property.
* <pre>
* <netui:content value="{actionForm.lastName}" /></pre>
- *
* @netui:tag name="content" body-content="empty" description="Used to display text or the result of an expression to the page."
* @netui.tldx:tag requiredchild="#nothing" renderer="workshop.netui.jspdesigner.tldx.ContentRenderer" bodycontentpref="empty"
*/
@@ -88,13 +81,9 @@
/**
* Set the default value of this Content.
* @param defaultValue - the default value
- * @jsptagref.attributedescription
- * The String literal or expression to be used as the default output.
- *
+ * @jsptagref.attributedescription The String literal or expression to be used as the default output.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_defaultOutput</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The String literal or expression to be used as the default output."
* @netui.tldx:attribute
@@ -102,19 +91,15 @@
public void setDefaultValue(String defaultValue)
throws JspException
{
- _defaultValue = setRequiredValueAttribute(defaultValue,"defaultValue");
+ _defaultValue = setRequiredValueAttribute(defaultValue, "defaultValue");
}
/**
* Set the value of this Content.
* @param value - the Content value
- * @jsptagref.attributedescription
- * The String literal or expression used to output the content.
- *
+ * @jsptagref.attributedescription The String literal or expression used to output the content.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_output</i>
- *
* @netui:attribute required="true" rtexprvalue="true" type="java.lang.Object"
* description="The String literal or expression used to output the content."
* @netui.tldx:attribute
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java Thu Nov 4 07:35:11 2004
@@ -40,29 +40,23 @@
* <li><b>error.suffix</b> - If present, the corresponding message will be
* rendered after each individual error message.</li>
* </ul>
- *
-
- * @jsptagref.tagdescription
- * Renders an error message with a given error key value if that key can be found in the
+ * @jsptagref.tagdescription Renders an error message with a given error key value if that key can be found in the
* ActionErrors registered in the <code>PageContext</code> at
- * <code>org.apache.struts.action.Action.ERROR_KEY</code>.
- *
+ * <code>org.apache.struts.action.Action.ERROR_KEY</code>.
+ *
* <p>The following optional message keys will be utilized if corresponding
* messages exist for them in the application resources:
* <blockquote>
* <ul>
* <li><b>error.prefix</b> - If present, the corresponding message will be
- * rendered before each individual error message.</li>
+ * rendered before each individual error message.</li>
* <li><b>error.suffix</b> - If present, the corresponding message will be
- * rendered after each individual error message.</li>
+ * rendered after each individual error message.</li>
* </ul>
* </blockquote>
- *
- * @example
- * In this sample, the "InvalidName" message from the errorMessages bundle will be used to output the error.
+ * @example In this sample, the "InvalidName" message from the errorMessages bundle will be used to output the error.
* <pre>
* <netui:error bundle="com.project.errorMessages" value="InvalidName"/></pre>
- *
* @netui:tag name="error" body-content="empty" description="Renders an error message with a given error key value."
* @netui.tldx:tag requiredchild="#nothing" renderer="workshop.netui.jspdesigner.tldx.ErrorRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -81,13 +75,9 @@
/**
* Set the value of the error key.
* @param value - the error key value
- * @jsptagref.attributedescription
- * The value for getting the error key
- *
+ * @jsptagref.attributedescription The value for getting the error key
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_value</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The value for getting the error key"
* @netui.tldx:attribute
@@ -95,7 +85,7 @@
public void setValue(String value)
throws JspException
{
- _value = setRequiredValueAttribute(value,"value");
+ _value = setRequiredValueAttribute(value, "value");
}
/**
@@ -103,7 +93,7 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
// Error will try an always work even if there are expression
// errors. The error will be reported at the end.
@@ -133,8 +123,7 @@
boolean suffixPresent = false;
String locale = _locale;
- if (!isMissingUserDefaultMessages(pageContext))
- {
+ if (!isMissingUserDefaultMessages(pageContext)) {
try {
// Check for presence of error prefix and suffix message keys
prefixPresent =
@@ -143,7 +132,7 @@
RequestUtils.present(pageContext, qualifiedBundle, locale, "error.suffix");
}
catch (JspException e) {
- String s = Bundle.getString("Tags_ErrorsException",new Object[]{e.getMessage()});
+ String s = Bundle.getString("Tags_ErrorsException", new Object[]{e.getMessage()});
registerTagError(s, null);
reportErrors();
return;
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java Thu Nov 4 07:35:11 2004
@@ -22,22 +22,21 @@
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
import org.apache.beehive.netui.tags.AbstractSimpleTag;
-import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
-import org.apache.struts.taglib.html.Constants;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.config.ControllerConfig;
import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.taglib.html.Constants;
import org.apache.struts.util.RequestUtils;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.el.ELException;
-import javax.servlet.http.HttpServletRequest;
import java.util.Locale;
-import java.util.MissingResourceException;
abstract public class ErrorBaseTag extends AbstractSimpleTag
{
@@ -67,9 +66,9 @@
* description="The name of the message bundle."
*/
public final void setBundle(String bundle)
- throws JspException
+ throws JspException
{
- _bundle = setRequiredValueAttribute(bundle,"bundle");
+ _bundle = setRequiredValueAttribute(bundle, "bundle");
}
/**
@@ -109,10 +108,10 @@
}
/**
- * @param report
- * @param bundle
+ * @param report
+ * @param bundle
* @return message
- * @throws JspException
+ * @throws JspException
*/
protected String getErrorMessage(ActionError report, String bundle)
throws JspException
@@ -123,30 +122,24 @@
PageContext pageContext = getPageContext();
// First, replace expressions in all the message arguments.
- if ( messageArgs != null )
- {
- for ( int i = 0; i < messageArgs.length; ++i )
- {
+ if (messageArgs != null) {
+ for (int i = 0; i < messageArgs.length; ++i) {
Object arg = messageArgs[i];
-
- if ( arg instanceof String )
- {
- String strArg = ( ( String ) arg );
-
- if ( strArg.startsWith( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX ) )
- {
- String argExpr= strArg.substring( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH );
- Object formBean = pageContext.getAttribute( Constants.BEAN_KEY, PageContext.REQUEST_SCOPE );
- HttpServletRequest request = ( HttpServletRequest ) pageContext.getRequest();
-
- try
- {
- messageArgs[i] = InternalExpressionUtils.evaluateMessage( argExpr, formBean, request,
- pageContext.getServletContext() );
+
+ if (arg instanceof String) {
+ String strArg = ((String) arg);
+
+ if (strArg.startsWith(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX)) {
+ String argExpr = strArg.substring(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH);
+ Object formBean = pageContext.getAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
+ HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+
+ try {
+ messageArgs[i] = InternalExpressionUtils.evaluateMessage(argExpr, formBean, request,
+ pageContext.getServletContext());
}
- catch(ELException e)
- {
- if(LOGGER.isErrorEnabled())
+ catch (ELException e) {
+ if (LOGGER.isErrorEnabled())
LOGGER.error("Exception occurred evaluating message expression '" + argExpr + "'. Cause: " + e.getCause(), e);
}
}
@@ -161,18 +154,15 @@
if (key.length() == 0) {
return "";
}
- else if (key.startsWith(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX))
- {
+ else if (key.startsWith(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX)) {
String expression = key.substring(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH);
- Object formBean = pageContext.getAttribute( Constants.BEAN_KEY, PageContext.REQUEST_SCOPE );
- HttpServletRequest request = ( HttpServletRequest ) pageContext.getRequest();
- try
- {
- message = InternalExpressionUtils.evaluateMessage( expression, formBean, request, pageContext.getServletContext() );
- }
- catch(ELException e)
- {
- if(LOGGER.isErrorEnabled())
+ Object formBean = pageContext.getAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
+ HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+ try {
+ message = InternalExpressionUtils.evaluateMessage(expression, formBean, request, pageContext.getServletContext());
+ }
+ catch (ELException e) {
+ if (LOGGER.isErrorEnabled())
LOGGER.error("Exception occurred evaluating message expression '" + expression + "'. Cause: " + e.getCause(), e);
}
}
@@ -181,20 +171,17 @@
boolean missingUserDefaultMessages = isMissingUserDefaultMessages(pageContext);
// First look in the default message bundle for the page flow.
- if (requestedSpecificBundle || ! missingUserDefaultMessages)
- {
+ if (requestedSpecificBundle || !missingUserDefaultMessages) {
message = RequestUtils.message(pageContext, bundle, _locale, key, messageArgs);
}
// If we didn't find it there, look for it in the validation messages associated with the form bean.
- if (message == null && ! requestedSpecificBundle)
- {
+ if (message == null && !requestedSpecificBundle) {
ActionMapping actionMapping = (ActionMapping) pageContext.getRequest().getAttribute(Globals.MAPPING_KEY);
- if (actionMapping instanceof PageFlowActionMapping)
- {
+ if (actionMapping instanceof PageFlowActionMapping) {
String formBeanResources = ((PageFlowActionMapping) actionMapping).getFormBeanMessageResourcesKey();
-
+
if (formBeanResources != null) {
String qualified = getQualifiedBundleName(formBeanResources);
message = RequestUtils.message(pageContext, qualified, _locale, key, messageArgs);
@@ -204,8 +191,7 @@
}
// If we still didn't find it, try the default validation message bundle (in beehive-netui-pageflow.jar).
- if (message == null && ! requestedSpecificBundle)
- {
+ if (message == null && !requestedSpecificBundle) {
String qualified = getQualifiedBundleName("_defaultValidationMessages");
message = RequestUtils.message(pageContext, qualified, _locale, key, messageArgs);
}
@@ -215,15 +201,13 @@
// message bundle in the page flow, that's the problem; otherwise, it's simply a missing message.
// Register a tag error for either case.
//
- if (message == null)
- {
- if (! requestedSpecificBundle && missingUserDefaultMessages) {
+ if (message == null) {
+ if (!requestedSpecificBundle && missingUserDefaultMessages) {
String s = Bundle.getString("Tags_ErrorsBundleMissing", null);
registerTagError(s, null);
return null;
}
- else
- {
+ else {
String s = Bundle.getString("Tags_ErrorsMessageMissing", key);
registerTagError(s, null);
return null;
@@ -233,26 +217,23 @@
return message;
}
-
+
/**
* Tell whether the current page flow has no default message bundle defined.
- *
* @return <code>true</code> if the current page flow (Struts module) has no user-specified default message bundle.
- */
+ */
protected static boolean isMissingUserDefaultMessages(PageContext pageContext)
{
ModuleConfig mc = RequestUtils.getModuleConfig(pageContext);
- if (mc != null)
- {
+ if (mc != null) {
ControllerConfig cc = mc.getControllerConfig();
- if (cc instanceof PageFlowControllerConfig)
- {
+ if (cc instanceof PageFlowControllerConfig) {
return ((PageFlowControllerConfig) cc).isMissingDefaultMessages();
}
}
-
+
return false;
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java Thu Nov 4 07:35:11 2004
@@ -22,7 +22,6 @@
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.util.RequestUtils;
-import org.apache.struts.util.ResponseUtils;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
@@ -45,10 +44,7 @@
* <li><b>errors.suffix</b> - If present, the corresponding message will be
* rendered after each individual error message.</li>
* </ul>
- *
-
- * @jsptagref.tagdescription
- * Renders the set of error messages found in the ActionErrors
+ * @jsptagref.tagdescription Renders the set of error messages found in the ActionErrors
* registered in the <code>PageContext</code> at org.apache.struts.action.Action.ERROR_KEY.
* <p>
* The following optional message keys will be utilized if corresponding
@@ -56,22 +52,19 @@
* <blockquote>
* <ul>
* <li><b>errors.header</b> - If present, the corresponding message will be
- * rendered prior to the individual list of error messages.</li>
+ * rendered prior to the individual list of error messages.</li>
* <li><b>errors.footer</b> - If present, the corresponding message will be
- * rendered following the individual list of error messages.</li>
+ * rendered following the individual list of error messages.</li>
* <li><b>errors.prefix</b> - If present, the corresponding message will be
- * rendered before each individual error message.</li>
+ * rendered before each individual error message.</li>
* <li><b>errors.suffix</b> - If present, the corresponding message will be
- * rendered after each individual error message.</li>
+ * rendered after each individual error message.</li>
* </ul>
* </blockquote>
- *
- * @example
- * In this sample, the messages from the <code>errorMessages</code> bundle will be used to
- * output the errors.
+ * @example In this sample, the messages from the <code>errorMessages</code> bundle will be used to
+ * output the errors.
* <pre>
* <netui:errors bundle="com.project.errorMessages" /></pre>
- *
* @netui:tag name="errors" body-content="empty" description="Used to report multiple validation errors."
* @netui.tldx:tag requiredchild="#nothing" renderer="workshop.netui.jspdesigner.tldx.ErrorsRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -90,7 +83,7 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
PageContext pageContext = getPageContext();
@@ -118,8 +111,7 @@
boolean suffixPresent = false;
String locale = _locale;
- if (!isMissingUserDefaultMessages(pageContext))
- {
+ if (!isMissingUserDefaultMessages(pageContext)) {
try {
// Check for presence of header and footer message keys
headerPresent =
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java Thu Nov 4 07:35:11 2004
@@ -17,7 +17,6 @@
*/
package org.apache.beehive.netui.tags.html;
-import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.pageflow.internal.ContextCache;
import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.HtmlExceptionFormatter;
@@ -32,17 +31,12 @@
* Renders formatted exception data, as found in the Request with the key:
* <code>org.apache.struts.action.Action.EXCEPTION_KEY</code>. Exceptions ignores its
* body content.
- *
- * @jsptagref.tagdescription
- * Renders exception messages and stack traces inline on the JSP page.
- *
- * @example
- * In this sample, the <netui:exceptions> tag will output the exception title and message,
- * but not the stacktraces.
+ * @jsptagref.tagdescription Renders exception messages and stack traces inline on the JSP page.
+ * @example In this sample, the <netui:exceptions> tag will output the exception title and message,
+ * but not the stacktraces.
* <pre><netui:exceptions showMessage="true" showStackTrace="false" /></pre>
- *
* @netui:tag name="exceptions" body-content="empty" description="Displays formatted exception messages."
- * @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ExceptionsRenderer" bodycontentpref="empty" whitespace="indent"
+ * @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ExceptionsRenderer" bodycontentpref="empty" whitespace="indent"
*/
public class Exceptions extends AbstractSimpleTag
{
@@ -61,13 +55,9 @@
/**
* Set whether or not the exception message is being shown.
* @param showMessage - true or false depending on the setting desired
- * @jsptagref.attributedescription
- * Boolean. Determines whether or not the exception message is shown. Defaults to <code>true</code>
- *
+ * @jsptagref.attributedescription Boolean. Determines whether or not the exception message is shown. Defaults to <code>true</code>
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_showMessage</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines whether or not the exception message is shown. Defaults to true."
*/
@@ -79,13 +69,9 @@
/**
* Set whether or not the stack trace is being shown.
* @param showStackTrace - true or false depending on the setting desired
- * @jsptagref.attributedescription
- * Boolean. Determines whether or not the stack trace is shown. Defaults to <code>false</code>
- *
+ * @jsptagref.attributedescription Boolean. Determines whether or not the stack trace is shown. Defaults to <code>false</code>
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_showStackTrace</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines whether or not the stack trace is shown. Defaults to false."
*/
@@ -110,7 +96,7 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
// First look for the exception in the pageflow/struts request attribute. If it's not there,
// look for it in the request attribute the container provides for web.xml-configured error
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FileUpload.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FileUpload.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FileUpload.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.InputFileTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.http.HttpServletRequest;
@@ -30,7 +31,7 @@
* Renders an input tag with type="file", with the given attributes. Usage of this tag requires the parent
* Form tag to have enctype="multipart/form-data".
*
-
+ *
*
* <p><b>Notes</b></p>
* <ul>
@@ -39,37 +40,36 @@
* <li>The page flow or form bean property pointed to with the FileUpload's dataSource
* should be of type <code>org.apache.struts.upload.FormFile</code>.</li>
* </ul>
- * @jsptagref.tagdescription
- * Renders an HTML input tag with which users can browse, select, and upload files
- * from their local machine.
- *
+ * @jsptagref.tagdescription Renders an HTML input tag with which users can browse, select, and upload files
+ * from their local machine.
+ *
* <p>To successfully upload files, the following two conditions must be met:
- *
+ *
* <blockquote>
* <ul>
- * <li>The <netui:fileUpload> tag must have a parent
+ * <li>The <netui:fileUpload> tag must have a parent
* {@link Form} tag with the attribute <code>enctype="multipart/form-data"</code>
- *
+ *
* <pre> <netui:form action="uploadFile" <b>enctype="multipart/form-data"</b>>
* ...
- * <netui:fileUpload tagId="inputbox" dataSource="{actionForm.theFile}" />
- * ...
+ * <netui:fileUpload tagId="inputbox" dataSource="{actionForm.theFile}" />
+ * ...
* </netui:form></pre>
- *
+ *
* </li>
- * <li>The <code>dataSource</code>
- * attribute must point to a Form Bean field of
+ * <li>The <code>dataSource</code>
+ * attribute must point to a Form Bean field of
* type <code>org.apache.struts.upload.FormFile</code>.
- *
+ *
* <pre> public static class UploadFileForm extends FormData
* {
* private <b>org.apache.struts.upload.FormFile</b> theFile;
- *
+ *
* public void setTheFile(org.apache.struts.upload.FormFile theFile)
* {
* this.theFile = theFile;
* }
- *
+ *
* public org.apache.struts.upload.FormFile getTheFile()
* {
* return this.theFile;
@@ -78,37 +78,34 @@
* </li>
* </ul>
* </blockquote>
- *
- * The <code>dataSource</code> attribute for the <netui:fileUpload> tag is write-only.
+ *
+ * The <code>dataSource</code> attribute for the <netui:fileUpload> tag is write-only.
* This means that the value of the <netui:fileUpload> tag
* cannot be read back into the tag on postback.
- *
- * @example
- * In the following example, note the <code>enctype</code> attribute of the
+ * @example In the following example, note the <code>enctype</code> attribute of the
* enclosing <netui:form> tag.
* <pre> <netui:form action="uploadFile" enctype="multipart/form-data">
* <netui:fileUpload tagId="inputbox" dataSource="{actionForm.theFile}" />
* <netui:button value="Upload File" />
* </netui:form></pre>
- *
- * Note that the <netui:fileUpload> tag submits the file to Form Bean property <code>theFile</code>. This
+ *
+ * Note that the <netui:fileUpload> tag submits the file to Form Bean property <code>theFile</code>. This
* property must be of type <code>org.apache.struts.upload.FormFile</code>:
- *
+ *
* <pre> public static class UploadFileForm extends FormData
* {
* private <b>org.apache.struts.upload.FormFile</b> theFile;
- *
+ *
* public void setTheFile(<b>org.apache.struts.upload.FormFile</b> theFile)
* {
* this.theFile = theFile;
* }
- *
+ *
* public <b>org.apache.struts.upload.FormFile</b> getTheFile()
* {
* return this.theFile;
* }
- * }</pre>
- *
+ * }</pre>
* @netui:tag name="fileUpload" description="Upload a file from the client to the server."
* @netui.tldx:tag requiredchild="attribute" renderer="workshop.netui.jspdesigner.tldx.FileUploadRenderer"
* bodycontentpref="empty" whitespace="indent"
@@ -162,13 +159,9 @@
/**
* Set the mime-types accepted for the FileUpload.
* @param accept - the accepted mime-types
- * @jsptagref.attributedescription
- * The set of MIME types accepted for file upload.
- *
+ * @jsptagref.attributedescription The set of MIME types accepted for file upload.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_acceptTheseMIMETypes</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The set of MIME types accepted for file upload."
*/
@@ -180,13 +173,9 @@
/**
* Set if this FileUpload is read-only.
* @param readonly - the read-only state
- * @jsptagref.attributedescription
- * Boolean. Determines whether or not the file upload field is read-only.
- *
+ * @jsptagref.attributedescription Boolean. Determines whether or not the file upload field is read-only.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_readOnly</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines whether or not the file upload field is read-only."
* @netui.tldx:attribute category="misc"
@@ -199,13 +188,9 @@
/**
* Set the size (in characters) of the FileUpload.
* @param size - the size
- * @jsptagref.attributedescription
- * Integer. The number of characters visible in the file upload field.
- *
+ * @jsptagref.attributedescription Integer. The number of characters visible in the file upload field.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>integer_fieldSize</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The number of characters visible in the file upload field."
* @netui.tldx:attribute category="misc"
@@ -275,14 +260,15 @@
if (hasErrors())
return reportAndExit(EVAL_PAGE);
- StringBuilder results = new StringBuilder(32);
+ //StringBuilder results = new StringBuilder(32);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_FILE_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java Thu Nov 4 07:35:11 2004
@@ -25,14 +25,11 @@
import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.pageflow.util.PageflowTagUtils;
import org.apache.beehive.netui.pageflow.util.URLRewriterService;
+import org.apache.beehive.netui.script.common.ImplicitObjectUtil;
import org.apache.beehive.netui.tags.IHtmlIdWriter;
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
-import org.apache.beehive.netui.tags.rendering.FormTag;
-import org.apache.beehive.netui.tags.rendering.InputHiddenTag;
-import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
-import org.apache.beehive.netui.script.common.ImplicitObjectUtil;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
@@ -54,96 +51,94 @@
/**
* This tag represents an input form, associated with a bean whose
* properties correspond to the various fields of the form.
+ * @jsptagref.tagdescription Renders an HTML form that can be submitted to a Java method
+ * in the Controller file for processesing.
*
- * @jsptagref.tagdescription
- * Renders an HTML form that can be submitted to a Java method
- * in the Controller file for processesing.
- *
* <p><b>Submitting Data</b></p>
- *
- * <p>When a <netui:form> is submitted, the form data is passed to a method
- * for processessing. The data is passed as a Form Bean instance.
+ *
+ * <p>When a <netui:form> is submitted, the form data is passed to a method
+ * for processessing. The data is passed as a Form Bean instance.
* The <netui:form>'s input fields correspond to the properties of the Form Bean.
* When the form is submitted the following sequence of events occurs:
- * (1) a new Form Bean instance is created, (2) the form data is loaded into the
- * corresponding Form Bean properties,
+ * (1) a new Form Bean instance is created, (2) the form data is loaded into the
+ * corresponding Form Bean properties,
* and (3) the Form Bean instance is passed to the method
* where the data is processed.
- *
+ *
* <p>The <code>action</code> attribute determines the target method of the submission.
- * The parameter of the target method determines the Form Bean instance
+ * The parameter of the target method determines the Form Bean instance
* that carries the submitted data.
- *
+ *
* <p>For example, if a <netui:form>'s target method is <code>someAction</code> ...
- *
+ *
* <pre> <netui:form action="<b>someAction</b>">
- * //
+ * //
* // input fields go here
- * //
+ * //
* <netui:button value="Submit" type="submit"/>
* </netui:form></pre>
- *
- * <p>...and the <code>someAction</code> method takes a Form Bean parameter of
+ *
+ * <p>...and the <code>someAction</code> method takes a Form Bean parameter of
* type <code>SomeFormBean</code>...
- *
+ *
* <pre> /**
* * @jpf:action
* * @jpf:forward name="success" path="showData.jsp"
* */
* protected Forward someAction(<b>SomeFormBean form</b>)</pre>
- *
- * <p>...then an instance of <code>SomeFormBean</code> will carry the submitted data.
- *
- * <p><b>Pre-populating Form Fields with the Session Object</b></p>
- *
- * <p>The <code>name</code>, <code>type</code>, and <code>scope</code> attributes can
- * be used together to pre-populate
- * the form fields with default values when they are first rendered in the browser.
- *
- * <p>In the Controller file, instantiate the appropriate Form Bean, set default values, and
- * store the Form Bean instance in the Session object.
- *
- * <pre> protected void onCreate()
+ *
+ * <p>...then an instance of <code>SomeFormBean</code> will carry the submitted data.
+ *
+ * <p><b>Pre-populating Form Fields with the Session Object</b></p>
+ *
+ * <p>The <code>name</code>, <code>type</code>, and <code>scope</code> attributes can
+ * be used together to pre-populate
+ * the form fields with default values when they are first rendered in the browser.
+ *
+ * <p>In the Controller file, instantiate the appropriate Form Bean, set default values, and
+ * store the Form Bean instance in the Session object.
+ *
+ * <pre> protected void onCreate()
* {
* // Create a new Form Bean instance
* ProcessDataForm formInstance = new ProcessDataForm();
- *
+ *
* // Set default values.
* formInstance.setAge(32);
* formInstance.setName("John");
- *
+ *
* // Store the instance in the Session object.
- * getSession().setAttribute("defaultValues", formInstance);
+ * getSession().setAttribute("defaultValues", formInstance);
* }</pre>
- *
- * <p>Then, use the <code>name</code>, <code>type</code>, and <code>scope</code> attributes to pre-populate the
- * form fields.
- *
- * <pre> <netui:form
- * action="processData"
- * name="defaultValues"
- * type="tagSamples.netui.form.FormController$ProcessDataForm"
+ *
+ * <p>Then, use the <code>name</code>, <code>type</code>, and <code>scope</code> attributes to pre-populate the
+ * form fields.
+ *
+ * <pre> <netui:form
+ * action="processData"
+ * name="defaultValues"
+ * type="tagSamples.netui.form.FormController$ProcessDataForm"
* scope="session"></pre>
- *
- * <p><b>Note:</b> when the data is submitted, the data is passed as a Request-scoped Form
+ *
+ * <p><b>Note:</b> when the data is submitted, the data is passed as a Request-scoped Form
* Bean, *not* as the Session-scoped Form Bean used to pre-populate the fields. However, you
- * may pass the data as a Page Flow-scoped Form Bean, if the annotation
+ * may pass the data as a Page Flow-scoped Form Bean, if the annotation
* <code>@jpf:action form="somePageFlowScopedBean"</code> is set on the receiving method.
- * For detailed information on Form Bean scopings see
+ * For detailed information on Form Bean scopings see
* <a href="{@docRoot}/../guide/netui/guide/conReqScopedVsPageScopedBean.html">Form Bean Scopings</a>
- *
- * <p><b>Pre-populating Form Fields By Passing a Form Bean Instance to the JSP Page</b></p>
- *
- * <p>As an alternative to the pre-population technique above, you can set the
- * pre-population values in a Form Bean instance and then pass that instance to the JSP page.
- * For example, assume that index.jsp contains the <netui:form> and input elements.
- * The following action method sets the pre-population values in a Form Bean instance
- * and passes that instance to the
- * <netui:form> and its input elements.
+ *
+ * <p><b>Pre-populating Form Fields By Passing a Form Bean Instance to the JSP Page</b></p>
+ *
+ * <p>As an alternative to the pre-population technique above, you can set the
+ * pre-population values in a Form Bean instance and then pass that instance to the JSP page.
+ * For example, assume that index.jsp contains the <netui:form> and input elements.
+ * The following action method sets the pre-population values in a Form Bean instance
+ * and passes that instance to the
+ * <netui:form> and its input elements.
* Note that the Forward object returned by the method has two parameters, the String "success"
* and the pre-populated form.
- *
- * <pre> /**
+ *
+ * <pre> /**
* * @jpf:action
* * @jpf:forward name="success" path="index.jsp"
* */
@@ -153,9 +148,7 @@
* form.setName("Mark");
* return new Forward("success", form);
* }</pre>
- *
- * @example
- * In this first sample, the
+ * @example In this first sample, the
* <netui:form> tag invokes the <code>processData</code>
* action method in the Controller file when the form is submitted.
* <pre> <netui:form action="processData">
@@ -164,9 +157,9 @@
* Age:
* <netui:textBox dataSource="{actionForm.age}"/>
* <netui:button value="Submit" type="submit"/>
- * </netui:form></pre>
- *
- * <p> Notice that the processData action method takes a parameter of
+ * </netui:form></pre>
+ *
+ * <p> Notice that the processData action method takes a parameter of
* type <code>ProcessDataForm</code>.</p>
* <pre> /**
* * @jpf:action
@@ -177,14 +170,14 @@
* //
* // Process the submitted data here.
* //
- *
+ *
* return new Forward("success");
* }</pre>
*
* <p>This means that the submitted data is loaded into an
- * instance of ProcessDataForm before
+ * instance of ProcessDataForm before
* it is passed to the action method.
- *
+ *
* <p>In this next sample, the form fields are pre-populated based upon default values
* stored in the Session object.
* <pre>
@@ -193,7 +186,6 @@
* Name: <netui:textBox dataSource="{actionForm.name}" />
* <netui:button value="Submit"/>
* </netui:form></pre>
- *
* @netui:tag name="form" description="Represents an input form, associated with a bean whose properties correspond to the various fields of the form."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.FormRenderer" illegalancestor="form" whitespace="indent"
* expressioninfo="workshop.netui.jspdesigner.tldx.expression.NetuiActionFormExpressionInfo"
@@ -279,33 +271,26 @@
/**
* Set the name of the action for the Form.
* @param action - the name of the action to set for the Form.
- * @jsptagref.attributedescription
- * Required. The action method invoked on form submit. Form data is passed to this method.
- *
+ * @jsptagref.attributedescription Required. The action method invoked on form submit. Form data is passed to this method.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_action</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The action method invoked on form submit. Form data is passed to this method."
* @netui.tldx:attribute reftype="netui-action-url"
*/
public void setAction(String action)
- throws JspException
+ throws JspException
{
- _state.action = setRequiredValueAttribute(action,"action");;
+ _state.action = setRequiredValueAttribute(action, "action");
+ ;
}
/**
* Set the content encoding to be used on a post submit.
* @param enctype - the content encoding type.
- * @jsptagref.attributedescription
- * The content encoding to be used on a POST submit.
- *
+ * @jsptagref.attributedescription The content encoding to be used on a POST submit.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_enctype</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The content encoding to be used on a POST submit."
* @netui.tldx:attribute category="misc"
@@ -334,13 +319,9 @@
/**
* Set the name of the field to receive focus.
* @param focus - the focus field name.
- * @jsptagref.attributedescription
- * The <code>tagID</code> of an input field which should receive initial focus.
- *
+ * @jsptagref.attributedescription The <code>tagID</code> of an input field which should receive initial focus.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_focus</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The tagID of an input field which should receive initial focus."
*/
@@ -352,13 +333,9 @@
/**
* Set the location hash to append to the url.
* @param location - the location hash
- * @jsptagref.attributedescription
- * The location hash to append to the URL.
- *
+ * @jsptagref.attributedescription The location hash to append to the URL.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_location</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The location hash to append to the URL."
* @netui.tldx:attribute category="misc"
@@ -371,19 +348,15 @@
/**
* Set the request method used when submitting this form.
* @param method - the request method
- * @jsptagref.attributedescription
- * The request method used when submitting this form.
- *
+ * @jsptagref.attributedescription The request method used when submitting this form.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_method</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The request method used when submitting this form."
* @netui.tldx:attribute category="misc"
*/
public void setMethod(String method)
- throws JspException
+ throws JspException
{
if (FORM_POST.equals(method) || FORM_GET.equals(method)) {
_state.method = method;
@@ -396,36 +369,28 @@
/**
* Set the attribute key under which our associated bean is stored.
* @param name - the attribute key name
- * @jsptagref.attributedescription
- * The attribute key under which the associated Form Bean used to populate the input form is stored.
+ * @jsptagref.attributedescription The attribute key under which the associated Form Bean used to populate the input form is stored.
* This Form Bean is found in the scope defined by the <code>scope</code> attribute.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_name</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The attribute key under which the associated Form Bean used to populate the input form is stored.
* This Form Bean is found in the scope defined by the scope attribute."
* @netui.tldx:attribute category="misc"
*/
public void setName(String name)
- throws JspException
+ throws JspException
{
// @todo: we need to verify what happens if this is null and type is set.
- _state.name = setRequiredValueAttribute(name,"name");
+ _state.name = setRequiredValueAttribute(name, "name");
}
/**
* Sets the onReset javascript event.
* @param onReset - the onReset event.
- * @jsptagref.attributedescription
- * The JavaScript onReset event.
- *
+ * @jsptagref.attributedescription The JavaScript onReset event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onSubmit</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The JavaScript onReset event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -438,13 +403,9 @@
/**
* Sets the onSubmit javascript event.
* @param onSubmit - the onReset event.
- * @jsptagref.attributedescription
- * The JavaScript onSubmit event.
- *
+ * @jsptagref.attributedescription The JavaScript onSubmit event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onSumbit</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The JavaScript onSubmit event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -458,16 +419,12 @@
* Sets the scope (request or session) under which the associated bean
* is stored.
* @param scope - the scope.
- * @jsptagref.attributedescription
- * The scope (<code>request</code> or <code>session</code>) under which the associated Form Bean
- * used to populate the form input fields is stored.
- * Using the <code>name</code>, <code>type</code> and <code>scope</code> attributes defines
+ * @jsptagref.attributedescription The scope (<code>request</code> or <code>session</code>) under which the associated Form Bean
+ * used to populate the form input fields is stored.
+ * Using the <code>name</code>, <code>type</code> and <code>scope</code> attributes defines
* the Form Bean used.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_scope</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The scope (request or session) under which the associated Form Bean
* used to populate the form input fields is stored.
@@ -476,21 +433,17 @@
* @netui.tldx:attribute category="misc"
*/
public void setScope(String scope)
- throws JspException
+ throws JspException
{
- _scope = setRequiredValueAttribute(scope,"scope");
+ _scope = setRequiredValueAttribute(scope, "scope");
}
/**
* Sets the window target.
* @param target - the window target.
- * @jsptagref.attributedescription
- * The window target
- *
+ * @jsptagref.attributedescription The window target
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_windowTarget</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The window target"
*/
@@ -502,15 +455,11 @@
/**
* Sets the Java class name of the bean to be created, if necessary.
* @param type - the class name
- * @jsptagref.attributedescription
- * The Java class name of the Form Bean to be created, if necessary.
- * This Form Bean will be created if the <code>name</code> and <code>scope</code> attributes are set.
+ * @jsptagref.attributedescription The Java class name of the Form Bean to be created, if necessary.
+ * This Form Bean will be created if the <code>name</code> and <code>scope</code> attributes are set.
* The Form Bean is then used to populate the form input fields.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_type</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The Java class name of the Form Bean to be created, if necessary.
* This Form Bean will be created if the name and scope attributes are set.
@@ -518,9 +467,9 @@
* @netui.tldx:attribute category="misc"
*/
public void setType(String type)
- throws JspException
+ throws JspException
{
- _type = setRequiredValueAttribute(type,"type");
+ _type = setRequiredValueAttribute(type, "type");
}
/**
@@ -532,7 +481,8 @@
* description="Generate the form submit JavaScript even if the form does not contain anchors."
* @netui.tldx:attribute category="misc"
*/
- public void setGenJavaScriptFormSubmit(boolean formSubmit) {
+ public void setGenJavaScriptFormSubmit(boolean formSubmit)
+ {
_formSubmit = formSubmit;
}
@@ -615,7 +565,7 @@
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
ServletContext servletContext = pageContext.getServletContext();
- lookup(request,servletContext);
+ lookup(request, servletContext);
if (hasErrors())
return SKIP_BODY;
@@ -670,7 +620,7 @@
}
if (hasErrors())
- return SKIP_BODY;
+ return SKIP_BODY;
if (bean instanceof ActionForm) {
((ActionForm) bean).reset(_mapping, request);
@@ -683,7 +633,7 @@
}
}
if (bean != null) {
- pageContext.setAttribute(Constants.BEAN_KEY, bean,PageContext.REQUEST_SCOPE);
+ pageContext.setAttribute(Constants.BEAN_KEY, bean, PageContext.REQUEST_SCOPE);
ImplicitObjectUtil.loadActionForm(pageContext, bean);
}
@@ -771,10 +721,11 @@
_state.action = actionUrl;
- int size = (_text != null) ? _text.length() + 64 : 128;
- StringBuilder results = new StringBuilder(size);
+ //int size = (_text != null) ? _text.length() + 64 : 128;
+ //StringBuilder results = new StringBuilder(size);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.FORM_TAG, request);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
// for the form, lets output the contents of the body and the end tag and exit if there are errors
//if (hasErrors()) {
@@ -794,7 +745,7 @@
String token =
(String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
if (token != null) {
- writeHiddenParam(Constants.TOKEN_KEY, token, results, request);
+ writeHiddenParam(Constants.TOKEN_KEY, token, writer, request);
}
}
@@ -808,12 +759,12 @@
String[] paramValArray = (String[]) paramValue;
for (int i = 0; i < paramValArray.length; i++) {
String paramName = URLRewriterService.rewriteName(servletContext, request, paramKey.toString());
- writeHiddenParam(paramName, paramValArray[i], results, request);
+ writeHiddenParam(paramName, paramValArray[i], writer, request);
}
}
else {
String paramName = URLRewriterService.rewriteName(servletContext, request, paramKey.toString());
- writeHiddenParam(paramName, paramValue.toString(), results, request);
+ writeHiddenParam(paramName, paramValue.toString(), writer, request);
}
}
}
@@ -822,13 +773,13 @@
if (extraHiddenParams != null) {
for (Iterator i = extraHiddenParams.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
- writeHiddenParam((String) entry.getKey(), (String) entry.getValue(), results, request);
+ writeHiddenParam((String) entry.getKey(), (String) entry.getValue(), writer, request);
}
}
// add the body content
if (_text != null)
- results.append(_text);
+ write(_text);
// Remove the page scope attributes we created
pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
@@ -840,15 +791,15 @@
if (_idList != null) {
int cnt = _idList.size();
for (int i = 0; i < cnt; i++) {
- writeHiddenParam(ID_PARAMETER_NAME, (String) _idList.get(i), results, request);
+ writeHiddenParam(ID_PARAMETER_NAME, (String) _idList.get(i), writer, request);
}
if (cnt > 0)
- results.append("\n");
+ write("\n");
}
}
// Render a tag representing the end of our current form
- br.doEndTag(results);
+ br.doEndTag(writer);
// Render JavaScript to set the input focus if required
if ((_focus != null) && (_focusMap != null)) {
@@ -859,7 +810,7 @@
String formName = (_beanName != null) ? _beanName : _formId;
String s = JavaScriptUtils.getFocusScript(formName, focusName);
if (s != null)
- results.append(s);
+ write(s);
}
}
@@ -867,14 +818,14 @@
JavaScriptUtils jsu = getJavaScriptUtils(request);
String s = jsu.writeAnchorFormSubmit(getScriptReporter());
if (s != null)
- results.append(s);
+ write(s);
}
// output any generated javascript
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -886,7 +837,8 @@
* @param results The StringBuilder to append the result to
* @param req THe servlet request
*/
- private void writeHiddenParam(String paramName, String paramValue, StringBuilder results, ServletRequest req)
+ private void writeHiddenParam(String paramName, String paramValue, AbstractRenderAppender results,
+ ServletRequest req)
{
// put each hidden on a new line
results.append("\n");
@@ -938,8 +890,8 @@
* <code>type</code> properties if necessary.
* @throws JspException if a required value cannot be looked up
*/
- private void lookup(HttpServletRequest request,ServletContext servletContext)
- throws JspException
+ private void lookup(HttpServletRequest request, ServletContext servletContext)
+ throws JspException
{
HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
@@ -984,7 +936,7 @@
// If we didn't find it in the current module's config, look in Global.app
if (_mapping == null) {
//ModuleConfig sharedFlowConfig = InternalUtils.getSharedFlowConfig(_appConfig, request, servletContext);
- SharedFlowController sfc = PageFlowUtils.getSharedFlow( request, servletContext );
+ SharedFlowController sfc = PageFlowUtils.getSharedFlow(request, servletContext);
if (sfc != null) {
ModuleConfig sharedFlowConfig = sfc.getModuleConfig();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java Thu Nov 4 07:35:11 2004
@@ -53,10 +53,8 @@
* <li>MMddyy</li>
* <li>and the local default</li>
* </ul>
-
- * @jsptagref.tagdescription
- * A formatter used to format dates. This formatter uses patterns that conform to
- * {@link java.text.SimpleDateFormat java.text.SimpleDateFormat} pattern syntax.
+ * @jsptagref.tagdescription A formatter used to format dates. This formatter uses patterns that conform to
+ * {@link java.text.SimpleDateFormat java.text.SimpleDateFormat} pattern syntax.
* Valid types for formatting are:
* <blockquote>
* <ul>
@@ -66,106 +64,106 @@
* <li>java.util.Calendar</li>
* </ul>
* </blockquote>
- *
+ *
* <p>The <netui:formatDate> tag formats the output of its parent tag. For example:
- *
+ *
* <pre> <netui:content value="{pageContext.euroDate}">
* <netui:formatDate pattern="dd-MM-yyyy" />
* </netui:content></pre>
- *
+ *
* <p>
* The following table summarizes the pattern letters that can be used.
* <table border=0 cellspacing=3 cellpadding=0>
- <tr bgcolor="#ccccff">
- <th align=left>Letter
- <th align=left>Date or Time Component
- <th align=left>Examples
- <tr>
- <td><code>G</code>
- <td>Era designator
- <td><code>AD</code>
- <tr bgcolor="#eeeeff">
- <td><code>y</code>
- <td>Year
- <td><code>1996</code>; <code>96</code>
- <tr>
- <td><code>M</code>
- <td>Month in year
- <td><code>July</code>; <code>Jul</code>; <code>07</code>
- <tr bgcolor="#eeeeff">
- <td><code>w</code>
- <td>Week in year
- <td><code>27</code>
- <tr>
- <td><code>W</code>
- <td>Week in month
- <td><code>2</code>
- <tr bgcolor="#eeeeff">
- <td><code>D</code>
- <td>Day in year
- <td><code>189</code>
- <tr>
- <td><code>d</code>
- <td>Day in month
- <td><code>10</code>
- <tr bgcolor="#eeeeff">
- <td><code>F</code>
- <td>Day of week in month
- <td><code>2</code>
- <tr>
- <td><code>E</code>
- <td>Day in week
- <td><code>Tuesday</code>; <code>Tue</code>
- <tr bgcolor="#eeeeff">
- <td><code>a</code>
- <td>Am/pm marker
- <td><code>PM</code>
- <tr>
- <td><code>H</code>
- <td>Hour in day (0-23)
- <td><code>0</code>
- <tr bgcolor="#eeeeff">
- <td><code>k</code>
- <td>Hour in day (1-24)
- <td><code>24</code>
- <tr>
- <td><code>K</code>
- <td>Hour in am/pm (0-11)
- <td><code>0</code>
- <tr bgcolor="#eeeeff">
- <td><code>h</code>
- <td>Hour in am/pm (1-12)
- <td><code>12</code>
- <tr>
- <td><code>m</code>
- <td>Minute in hour
- <td><code>30</code>
- <tr bgcolor="#eeeeff">
- <td><code>s</code>
- <td>Second in minute
- <td><code>55</code>
- <tr>
- <td><code>S</code>
- <td>Millisecond
- <td><code>978</code>
- <tr bgcolor="#eeeeff">
- <td><code>z</code>
- <td>Time zone
- <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>
- <tr>
- <td><code>Z</code>
- <td>Time zone
- <td><code>-0800</code>
-</table>
+ * <tr bgcolor="#ccccff">
+ * <th align=left>Letter
+ * <th align=left>Date or Time Component
+ * <th align=left>Examples
+ * <tr>
+ * <td><code>G</code>
+ * <td>Era designator
+ * <td><code>AD</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>y</code>
+ * <td>Year
+ * <td><code>1996</code>; <code>96</code>
+ * <tr>
+ * <td><code>M</code>
+ * <td>Month in year
+ * <td><code>July</code>; <code>Jul</code>; <code>07</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>w</code>
+ * <td>Week in year
+ * <td><code>27</code>
+ * <tr>
+ * <td><code>W</code>
+ * <td>Week in month
+ * <td><code>2</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>D</code>
+ * <td>Day in year
+ * <td><code>189</code>
+ * <tr>
+ * <td><code>d</code>
+ * <td>Day in month
+ * <td><code>10</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>F</code>
+ * <td>Day of week in month
+ * <td><code>2</code>
+ * <tr>
+ * <td><code>E</code>
+ * <td>Day in week
+ * <td><code>Tuesday</code>; <code>Tue</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>a</code>
+ * <td>Am/pm marker
+ * <td><code>PM</code>
+ * <tr>
+ * <td><code>H</code>
+ * <td>Hour in day (0-23)
+ * <td><code>0</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>k</code>
+ * <td>Hour in day (1-24)
+ * <td><code>24</code>
+ * <tr>
+ * <td><code>K</code>
+ * <td>Hour in am/pm (0-11)
+ * <td><code>0</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>h</code>
+ * <td>Hour in am/pm (1-12)
+ * <td><code>12</code>
+ * <tr>
+ * <td><code>m</code>
+ * <td>Minute in hour
+ * <td><code>30</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>s</code>
+ * <td>Second in minute
+ * <td><code>55</code>
+ * <tr>
+ * <td><code>S</code>
+ * <td>Millisecond
+ * <td><code>978</code>
+ * <tr bgcolor="#eeeeff">
+ * <td><code>z</code>
+ * <td>Time zone
+ * <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>
+ * <tr>
+ * <td><code>Z</code>
+ * <td>Time zone
+ * <td><code>-0800</code>
+ * </table>
* </p>
- *
- * The number of pattern letters used determines the final presentation. For example,
+ *
+ * The number of pattern letters used determines the final presentation. For example,
* yy specifies a 2 digit year, while yyyy specifies a four digit year. For detailed information see
* {@link java.text.SimpleDateFormat java.text.SimpleDateFormat}.
- *
+ *
* <p>
- * If the input type is a String, <netui:formatDate> attempts to
- * convert the String into a java.util.Date object before formatting.
+ * If the input type is a String, <netui:formatDate> attempts to
+ * convert the String into a java.util.Date object before formatting.
* For the conversion to succeed, the
* String must conform to a format listed below.
* <p>
@@ -178,13 +176,10 @@
* <li>the local default</li>
* </ul>
* </blockquote>
- *
- * @example
- * In this sample, the <netui:label> tag's output will be formatted to something like 08/29/1957.
+ * @example In this sample, the <netui:label> tag's output will be formatted to something like 08/29/1957.
* <pre> <netui:label value="{pageContext.today}">
* <netui:formatDate pattern="MM/dd/yyyy" />
* </netui:label></pre>
- *
* @netui:tag name="formatDate" body-content="empty" description="A formatter used to format dates."
* @netui.tldx:tag requiredparent="label span select textArea textBox data:anchorColumn data:literalColumn"
* requiredchild="#nothing"
@@ -213,21 +208,17 @@
* Set the pattern to use to convert a String value into a date. This
* will be used before the common formats.
* @param inputPattern the pattern representing the string input
- * @jsptagref.attributedescription
- * The pattern used to convert a String value into a date.
- *
+ * @jsptagref.attributedescription The pattern used to convert a String value into a date.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_stringInputPattern</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The pattern used to convert a String value into a date."
* @netui.tldx:attribute
*/
public void setStringInputPattern(String inputPattern)
- throws JspException
+ throws JspException
{
- _stringInput = setRequiredValueAttribute(inputPattern,"stringInputPattern");
+ _stringInput = setRequiredValueAttribute(inputPattern, "stringInputPattern");
}
/**
@@ -235,9 +226,9 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
- JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
+ JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, Formattable.class);
// if there are errors we need to either add these to the parent AbstractBastTag or report an error.
if (hasErrors()) {
@@ -259,7 +250,7 @@
}
else {
String s = Bundle.getString("Tags_FormattableParentRequired");
- registerTagError(s,null);
+ registerTagError(s, null);
reportErrors();
}
}
@@ -300,7 +291,7 @@
}
}
catch (IllegalArgumentException e) {
- String s = Bundle.getString("Tags_DateFormatPatternException",new Object[]{e.getMessage()});
+ String s = Bundle.getString("Tags_DateFormatPatternException", new Object[]{e.getMessage()});
logger.warn(s);
throw new JspException(s);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java Thu Nov 4 07:35:11 2004
@@ -36,34 +36,31 @@
* <li>currency</li>
* <li>percent</li>
* </ul>
+ * @jsptagref.tagdescription A formatter used to format numbers.
+ *
+ * <p>The <netui:formatNumber> tag formats the output of its parent tag. For example:
*
-
- * @jsptagref.tagdescription
- * A formatter used to format numbers.
- *
- * <p>The <netui:formatNumber> tag formats the output of its parent tag. For example:
- *
* <pre> <netui:label value="{price}">
* <netui:formatNumber country="FR" language="fr" type="currency" />
- * </netui:label></pre>
- *
+ * </netui:label></pre>
+ *
* <p>The <code>pattern</code> attribute conforms to
* {@link java.text.DecimalFormat java.text.DecimalFormat} pattern syntax.
- *
- * <p>The <code>pattern</code> attribute uses the comma as a grouping separater.
- * If many different grouping sizes are specified in one <code>pattern</code>,
+ *
+ * <p>The <code>pattern</code> attribute uses the comma as a grouping separater.
+ * If many different grouping sizes are specified in one <code>pattern</code>,
* the right-most grouping interval will be used throughout; the other grouping intervals
* will be ignored. For example, the following format patterns all produce the same result.
* If the number to format is 123456789, each will produce 123,456,789.
* <blockquote>
* <ul>
- * <li>pattern="#,##,###,###"</li>
- * <li>pattern="######,###"</li>
- * <li>pattern="##,####,###"</li>
+ * <li>pattern="#,##,###,###"</li>
+ * <li>pattern="######,###"</li>
+ * <li>pattern="##,####,###"</li>
* </ul>
* </blockquote>
- *
- * <p>The <code>type</code> attribute specifies three common
+ *
+ * <p>The <code>type</code> attribute specifies three common
* kinds of formatting to be applied to the number.
* The valid values for the <code>type</code> attribute are:
* <blockquote>
@@ -73,38 +70,35 @@
* <li><code>percent</code></li>
* </ul>
* </blockquote>
- *
- * <p>The <code>country</code> attribute takes an upper-case,
+ *
+ * <p>The <code>country</code> attribute takes an upper-case,
* two-letter code as defined by ISO-3166.
- * For a list of country codes see
+ * For a list of country codes see
* <a href="{@docRoot}/../reference/refISO3166CountryCodes.html">
* ISO-3166 Country Codes </a>
- *
- * <p>The <code>language</code> attribute takes a lower-case,
+ *
+ * <p>The <code>language</code> attribute takes a lower-case,
* two-letter code as defined by ISO-639.
- * For a list of
- * ISO-639 language codes see
+ * For a list of
+ * ISO-639 language codes see
* <a href="{@docRoot}/../reference/refISO639LanguageCodes.html">
- * ISO-639 Language Codes </a>
- *
- * @example
- * In this first example, the value "12345678" is formatted
+ * ISO-639 Language Codes </a>
+ * @example In this first example, the value "12345678" is formatted
* to 12,345,678.00.
* <pre> <netui:label value="12345678">
* <netui:formatNumber pattern="#,###.00" />
* </netui:label></pre>
- *
+ *
* <p>In the next sample, the value ".33" is formatted to 33%.</p>
* <pre> <netui:label value=".33">
* <netui:formatNumber type="percent" />
* </netui:label></pre>
- *
+ *
* <p>In the next sample, the value "14.317" is formatted
* to $14.32.</p>
* <pre> <netui:label value="14.317">
* <netui:formatNumber country="US" language="en" type="currency" />
* </netui:label></pre>
- *
* @netui:tag name="formatNumber" body-content="empty" description="A formatter used to format numbers."
* @netui.tldx:tag requiredparent="label span select textArea textBox data:anchorColumn data:literalColumn"
* requiredchild="#nothing"
@@ -127,27 +121,23 @@
return "FormatNumber";
}
- /**
+ /**
* Sets the type of number format to be used (number, currency, or percent).
* @param type - the number format type.
- * @jsptagref.attributedescription
- * The type of the format to apply. Possible values are <code>number</code>, <code>currency</code>, or <code>percent</code>.
- *
+ * @jsptagref.attributedescription The type of the format to apply. Possible values are <code>number</code>, <code>currency</code>, or <code>percent</code>.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_type</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The type of the format to apply. Possible values are number, currency, or percent."
*/
public void setType(String type)
- throws JspException
+ throws JspException
{
- _type = setRequiredValueAttribute(type,"type");
+ _type = setRequiredValueAttribute(type, "type");
if (_type != null) {
if (!type.equals("number") && !type.equals("currency") && !type.equals("percent")) {
String s = Bundle.getString("Tags_NumberFormatWrongType");
- registerTagError(s,null);
+ registerTagError(s, null);
}
}
}
@@ -157,9 +147,9 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
- JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
+ JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, Formattable.class);
// if there are errors we need to either add these to the parent AbstractBastTag or report an error.
if (hasErrors()) {
@@ -182,7 +172,7 @@
}
else {
String s = Bundle.getString("Tags_FormattableParentRequired");
- registerTagError(s,null);
+ registerTagError(s, null);
reportErrors();
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java Thu Nov 4 07:35:11 2004
@@ -52,16 +52,14 @@
* <p>
* If the truncate attribute is set to "true", characters in the string that exceed the pattern
* will be dropped. Otherwise, they will be appended to the end of the formatted string.
+ * @jsptagref.tagdescription A formatter used to format strings.
*
- * @jsptagref.tagdescription
- * A formatter used to format strings.
- *
* <p>The <netui:formatString> tag formats the output of its parent tag. For example:
- *
+ *
* <pre> <netui:label value="{pageFlow.phone}">
* <netui:formatString pattern="phone number: (###) ###-####"/>
* </netui:label> </pre>
- *
+ *
* <p>
* <netui:formatString> uses the following pattern syntax:
* <p>
@@ -85,14 +83,11 @@
* <p>
* If the <code>truncate</code> attribute is set to "true", characters in the String that exceed the pattern
* will be dropped. Otherwise, they will be appended to the end of the formatted String.
- *
- * @example
- * In this sample, the String "2125555555" will be formatted to this form: (212)555-5555.
- *
+ * @example In this sample, the String "2125555555" will be formatted to this form: (212)555-5555.
+ *
* <pre> <netui:label value="2125555555">
* <netui:formatString pattern="phone (###) ###-####"/>
* </netui:label> </pre>
- *
* @netui:tag name="formatString" body-content="empty" description="A formatter used to format strings."
* @netui.tldx:tag requiredparent="label span select textArea textBox data:anchorColumn data:literalColumn"
* requiredchild="#nothing"
@@ -116,13 +111,9 @@
/**
* Sets whether or not pattern-exceeding characters should be dropped.
* @param truncate - "true" or "false"
- * @jsptagref.attributedescription
- * A boolean specifying whether characters that exceed the pattern's length should be dropped.
- *
+ * @jsptagref.attributedescription A boolean specifying whether characters that exceed the pattern's length should be dropped.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_truncate</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="A boolean specifying whether characters that exceed the pattern's length should be dropped."
*/
@@ -136,9 +127,9 @@
* @throws JspException if a JSP exception has occurred
*/
public void doTag()
- throws JspException
+ throws JspException
{
- JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
+ JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, Formattable.class);
// if there are errors we need to either add these to the parent AbstractBastTag or report an error.
if (hasErrors()) {
@@ -159,7 +150,7 @@
}
else {
String s = Bundle.getString("Tags_FormattableParentRequired");
- registerTagError(s,null);
+ registerTagError(s, null);
reportErrors();
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatTag.java Thu Nov 4 07:35:11 2004
@@ -60,14 +60,14 @@
* @return the locale
*/
public Locale getLocale()
- throws JspException
+ throws JspException
{
Locale loc = null;
if (_language != null || _country != null) {
// language is required
if (_language == null) {
- String s = Bundle.getString("Tags_LocaleRequiresLanguage",new Object[]{_country});
- registerTagError(s,null);
+ String s = Bundle.getString("Tags_LocaleRequiresLanguage", new Object[]{_country});
+ registerTagError(s, null);
return super.getUserLocale();
}
@@ -92,7 +92,7 @@
public void setPattern(String pattern)
throws JspException
{
- _pattern = setRequiredValueAttribute(pattern,"patttern");
+ _pattern = setRequiredValueAttribute(pattern, "patttern");
}
/**
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.InputHiddenTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.ServletRequest;
@@ -29,20 +30,16 @@
/**
* Generates a hidden tag with a given value. Hidden ignores its body content.
+ * @jsptagref.tagdescription Generates an HTML hidden tag with a given value.
*
- * @jsptagref.tagdescription
- * Generates an HTML hidden tag with a given value.
- *
- * <p>The <code>dataInput</code> attribute overrides the <code>dataSource</code> attribute
- * for the input of the value.
- * It allows a <netui:hidden> tag to read it's value from one place (whatever is referenced by
- * the <code>dataInput</code> attribute) and submit the value to a new destination
- * (whatever is referenced by the <code>dataSource</code> attribute).
+ * <p>The <code>dataInput</code> attribute overrides the <code>dataSource</code> attribute
+ * for the input of the value.
+ * It allows a <netui:hidden> tag to read it's value from one place (whatever is referenced by
+ * the <code>dataInput</code> attribute) and submit the value to a new destination
+ * (whatever is referenced by the <code>dataSource</code> attribute).
* The <code>dataInput</code> attribute may take a String literal or a data binding expression.
- *
* @example In this sample, the Hidden tag is written using the value from the form bean's status property.
* <pre><netui:hidden dataSource="{actionForm.status}" /></pre>
- *
* @netui:tag name="hidden" description="Generates a hidden tag with a given value."
* @netui.tldx:tag requiredchild="attribute"
* renderer="workshop.netui.jspdesigner.tldx.HiddenRenderer"
@@ -99,17 +96,13 @@
* dataSource</code> and provide the input value on the select box.
* @param dataInput the value of the input to the page. This value
* may contain an expression.
- * @jsptagref.attributedescription
- * The dataInput attribute overrides the dataSource attribute for the input of the value.
+ * @jsptagref.attributedescription The dataInput attribute overrides the dataSource attribute for the input of the value.
* It allows a <netui:hidden> tag to read it's value from one place (whatever is referenced by
- * the <code>dataInput</code> attribute) and return the value to a new destination (whatever is
+ * the <code>dataInput</code> attribute) and return the value to a new destination (whatever is
* referenced by the <code>dataSource</code> attribute).
* This attribute may take a String literal or a data binding expression.
- *
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_dataInput</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="java.lang.Object"
* description="The dataInput attribute overrides the dataSource attribute for the input of the value. "
* @netui.tldx:attribute
@@ -169,7 +162,7 @@
}
// Create an appropriate "input" element based on our parameters
- StringBuilder results = new StringBuilder(32);
+ //StringBuilder results = new StringBuilder(32);
if (_dataSource != null) {
name = doNaming();
@@ -192,19 +185,20 @@
idScript = renderTagId(_state, null, true, false);
}
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
if (hasErrors()) {
reportErrors();
localRelease();
return SKIP_BODY;
}
- hiddenTag.doStartTag(results, _state);
- hiddenTag.doEndTag(results);
+ hiddenTag.doStartTag(writer, _state);
+ hiddenTag.doEndTag(writer);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
// Continue processing this page
localRelease();
@@ -232,14 +226,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java Thu Nov 4 07:35:11 2004
@@ -18,10 +18,11 @@
package org.apache.beehive.netui.tags.html;
import org.apache.beehive.netui.tags.AbstractPageError;
-import org.apache.beehive.netui.tags.IErrorReporter;
import org.apache.beehive.netui.tags.ErrorHandling;
+import org.apache.beehive.netui.tags.IErrorReporter;
import org.apache.beehive.netui.tags.rendering.HtmlTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.struts.Globals;
@@ -35,12 +36,9 @@
/**
* Generates the html element and performs error handling within its body.
- *
- * @jsptagref.tagdescription
- * <p>
+ * @jsptagref.tagdescription <p>
* Renders an <html> tag.
* </p>
- *
* @example In this sample, the <netui:html> tag uses the default locale and the direction of the HTML is
* left-to-right (LTR).
* <pre><netui:html dir="LTR" useLocale="true" /></pre>
@@ -82,7 +80,6 @@
* results.append("\tif (tag.scopeId != null) return tag.scopeId;\n");
* results.append("\treturn getScopeId(tag.parentElement);\n}\n\n");
* </pre>
- *
* @netui:tag name="html" description="Generates the html element and performs error handling within its body."
* @netui.tldx:tag bodycontentpref="empty" renderer="workshop.netui.jspdesigner.tldx.HtmlRenderer"
* output="<html>|$children|</html>"
@@ -130,7 +127,7 @@
/**
* This method will return the TagRenderBase enum value for the document type. The default
* value is HTML 4.01.
- * @return int
+ * @return int
*/
public int getTargetDocumentType()
{
@@ -217,14 +214,15 @@
}
// write out the html...
- StringBuilder sb = new StringBuilder(32);
+ //StringBuilder sb = new StringBuilder(32);
_state.lang = currentLocale.getLanguage();
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
_br = TagRenderingBase.Factory.getRendering(TagRenderingBase.HTML_TAG, req);
- _br.doStartTag(sb, _state);
- sb.append("\n");
+ _br.doStartTag(writer, _state);
+ write("\n");
- write(sb.toString());
+ //write(sb.toString());
// allow the super class to write out the <div>
super.doStartTag();
@@ -246,7 +244,7 @@
// String script = writeScriptBlock();
// ResponseUtils.write(pageContext, script);
- StringBuilder sb = new StringBuilder(32);
+ //StringBuilder sb = new StringBuilder(32);
if (!isInitScriptWritten()) {
String s = Bundle.getString("Tags_ClientReqScriptHeader", null);
@@ -254,23 +252,23 @@
}
// if there are errors then we should output the error table
- ErrorHandling.reportCollectedErrors(sb,this);
+ ErrorHandling.reportCollectedErrors(pageContext, this);
// @todo: this should also be written out by the body tag if it is present
if (getScopeId() != null) {
- sb.append("</div>");
+ write("</div>");
}
// the script can be written out by another tag, typically this would be the <body> tag.
// If it hasn't been written out, then we will right it out now.
if (!isScriptWritten() && isInitScriptWritten()) {
- writeScript(sb);
+ writeScript(pageContext);
}
// close the html tag
- sb.append("\n");
- _br.doEndTag(sb);
- write(sb.toString());
+ write("\n");
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ _br.doEndTag(writer);
localRelease();
return EVAL_PAGE;
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java Thu Nov 4 07:35:11 2004
@@ -78,14 +78,9 @@
/**
* Sets the style of the rendered html tag.
* @param style - the html style.
- *
- * @jsptagref.attributedescription
- * The style.
- *
+ * @jsptagref.attributedescription The style.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_style</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The style."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.JspStyleProperty" category="format"
@@ -101,14 +96,9 @@
/**
* Sets the style class of the rendered html tag.
* @param styleClass - the html style class.
- *
- * @jsptagref.attributedescription
- * The style class.
- *
+ * @jsptagref.attributedescription The style class.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_style_class</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The style class."
* @netui.tldx:attribute category="Format"
@@ -124,64 +114,60 @@
/**
* Set the ID of the tag.
* @param tagId - the tagId. A value is required.
- *
- * @jsptagref.attributedescription
- * <p>String value. Sets the <code>id</code> (or <code>name</code>) attribute of the rendered HTML tag.
- * Note that the real id attribute rendered in the browser may be
- * changed by the application container (for example, Portal containers may change
- * the rendered id value to ensure the uniqueness of
+ * @jsptagref.attributedescription <p>String value. Sets the <code>id</code> (or <code>name</code>) attribute of the rendered HTML tag.
+ * Note that the real id attribute rendered in the browser may be
+ * changed by the application container (for example, Portal containers may change
+ * the rendered id value to ensure the uniqueness of
* id's on the page). In this case, the real id rendered
- * in the browser may be looked up
+ * in the browser may be looked up
* through the JavaScript function getNetuiTagName( tagId, tag )</code>.
- *
+ *
* <p>For example, assume that some tag's <code>tagId</code> attribute is set to <code>foo</code>.
*
* <pre> <netui:textBox <b>tagId="foo"</b> /></pre>
*
* <p>Then the following JavaScript function will return the real id attribute rendered in the browser:
- *
- * <pre> getNetuiTagName( "foo", this )</pre>
- *
- * <p>To get a <netui:form> element and all of its children elements in JavaScript, use
- * the same JavaScript function <code>getNetuiTagName( tagId, tag )</code>. For example,
- * assume that there is a <netui:form> whose
+ *
+ * <pre> getNetuiTagName( "foo", this )</pre>
+ *
+ * <p>To get a <netui:form> element and all of its children elements in JavaScript, use
+ * the same JavaScript function <code>getNetuiTagName( tagId, tag )</code>. For example,
+ * assume that there is a <netui:form> whose
* tagId attribute is set to <code>bar</code>.
- *
+ *
* <pre> <netui:form <b>tagId="bar"</b> ></pre>
- *
- * <p>Then the following JavaScript function will return the <netui:form> element
+ *
+ * <p>Then the following JavaScript function will return the <netui:form> element
* and its children (packaged as an array).
*
* <pre> document[getNetuiTagName( "bar", this )]</pre>
*
* <p>To retreive the value entered into a <netui:textBox> within the <netui:form> tag, use the following
- * JavaScript expression.
+ * JavaScript expression.
*
* <pre> document[getNetuiTagName("bar", this)][getNetuiTagName("foo", this)].value</pre>
- *
- * <p>The second parameter ensures that the JavaScript function
- * begins its search within the correct Portlet scope. Pass the
+ *
+ * <p>The second parameter ensures that the JavaScript function
+ * begins its search within the correct Portlet scope. Pass the
* JavaScript keyword <code>this</code> as the second parameter.
- *
- * For detailed information on using the function
- * <code>getNetuiTagName( tagId, tag )</code> see
+ *
+ * For detailed information on using the function
+ * <code>getNetuiTagName( tagId, tag )</code> see
* <a href="{@docRoot}/../guide/netui/guide/conUsingJavaScript.html">
* Using JavaScript in Page Flow and Portal Applications</a>.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tagId</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="String value. Sets the id (or name) attribute of the rendered HTML tag. "
* @netui.tldx:attribute category="general"
*/
public void setTagId(String tagId)
- throws JspException
+ throws JspException
{
// JSP 2.0 EL will convert a null into a empty string "". If we get a "" we will display an error.
AbstractHtmlState tsh = getState();
- tsh.id = setRequiredValueAttribute(tagId,"tagId");;
+ tsh.id = setRequiredValueAttribute(tagId, "tagId");
+ ;
}
/**
@@ -200,14 +186,9 @@
/**
* Sets the value of the title attribute.
* @param title
- *
- * @jsptagref.attributedescription
- * The title.
- *
+ * @jsptagref.attributedescription The title.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_title</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The title. "
* @netui.tldx:attribute category="misc"
@@ -222,14 +203,9 @@
/**
* Sets the lang attribute for the HTML element.
* @param lang
- *
- * @jsptagref.attributedescription
- * The lang.
- *
+ * @jsptagref.attributedescription The lang.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_lang</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The lang."
* @netui.tldx:attribute category="internationalization"
@@ -243,14 +219,9 @@
/**
* Sets the lang attribute for the HTML element.
* @param dir
- *
- * @jsptagref.attributedescription
- * The dir.
- *
+ * @jsptagref.attributedescription The dir.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_dir</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The dir."
* @netui.tldx:attribute category="internationalization"
@@ -275,14 +246,9 @@
/**
* Sets the onClick javascript event.
* @param onclick - the onClick event.
- *
- * @jsptagref.attributedescription
- * The onClick JavaScript event.
- *
+ * @jsptagref.attributedescription The onClick JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onClick</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onClick JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -296,14 +262,9 @@
/**
* Sets the onDblClick javascript event.
* @param ondblclick - the onDblClick event.
- *
- * @jsptagref.attributedescription
- * The onDblClick JavaScript event.
- *
+ * @jsptagref.attributedescription The onDblClick JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onDblClick</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onDblClick JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -317,14 +278,9 @@
/**
* Sets the onKeyDown javascript event.
* @param onkeydown - the onKeyDown event.
- *
- * @jsptagref.attributedescription
- * The onKeyDown JavaScript event.
- *
+ * @jsptagref.attributedescription The onKeyDown JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onKeyDown JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -338,14 +294,9 @@
/**
* Sets the onKeyPress javascript event.
* @param onkeypress - the onKeyPress event.
- *
- * @jsptagref.attributedescription
- * The onKeyPress JavaScript event.
- *
+ * @jsptagref.attributedescription The onKeyPress JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onKeyPress JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -359,14 +310,9 @@
/**
* Sets the onKeyUp javascript event.
* @param onkeyup - the onKeyUp event.
- *
- * @jsptagref.attributedescription
- * The onKeyUp JavaScript event.
- *
+ * @jsptagref.attributedescription The onKeyUp JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onKeyUp JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -380,14 +326,9 @@
/**
* Sets the onMouseDown javascript event.
* @param onmousedown - the onMouseDown event.
- *
- * @jsptagref.attributedescription
- * The onMouseDown JavaScript event.
- *
+ * @jsptagref.attributedescription The onMouseDown JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onMouseDown</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onMouseDown JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -401,14 +342,9 @@
/**
* Sets the onMouseMove javascript event.
* @param onmousemove - the onMouseMove event.
- *
- * @jsptagref.attributedescription
- * The onMouseMove JavaScript event.
- *
+ * @jsptagref.attributedescription The onMouseMove JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onMouseMove</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onMouseMove JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -422,14 +358,9 @@
/**
* Sets the onMouseOut javascript event.
* @param onmouseout - the onMouseOut event.
- *
- * @jsptagref.attributedescription
- * The onMouseOut JavaScript event.
- *
+ * @jsptagref.attributedescription The onMouseOut JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onMouseOut</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onMouseOut JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -443,14 +374,9 @@
/**
* Sets the onMouseOver javascript event.
* @param onmouseover - the onMouseOver event.
- *
- * @jsptagref.attributedescription
- * The onMouseOver JavaScript event.
- *
+ * @jsptagref.attributedescription The onMouseOver JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onMouseOver</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onMouseOver JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
@@ -464,14 +390,9 @@
/**
* Sets the onMouseUp javascript event.
* @param onmouseup - the onMouseUp event.
- *
- * @jsptagref.attributedescription
- * The onMouseUp JavaScript event.
- *
+ * @jsptagref.attributedescription The onMouseUp JavaScript event.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_onMouseUp</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The onMouseUp JavaScript event."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.EventPropertyClass" category="event"
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java Thu Nov 4 07:35:11 2004
@@ -18,8 +18,8 @@
package org.apache.beehive.netui.tags.html;
import org.apache.beehive.netui.tags.AbstractClassicTag;
-import org.apache.beehive.netui.tags.IHtmlIdWriter;
import org.apache.beehive.netui.tags.ExpressionHandling;
+import org.apache.beehive.netui.tags.IHtmlIdWriter;
import javax.servlet.jsp.JspException;
import java.util.List;
@@ -40,39 +40,34 @@
/**
* Sets the tag's data source (can be an expression).
* @param dataSource the data source
- *
- * @jsptagref.attributedescription
- * <p>The <code>dataSource</code> attribute determines both
- * (1) the source of populating data for the tag and
+ * @jsptagref.attributedescription <p>The <code>dataSource</code> attribute determines both
+ * (1) the source of populating data for the tag and
* (2) the object to which the tag submits data.
- *
+ *
* <p>For example, assume that the Controller file (= JPF file) contains
* a Form Bean with the property foo. Then the following <netui:textBox> tag will
* (1) draw populating data from the Form Bean's foo property and (2)
* submit user defined data to the same property.
- *
- * <p> <code><netui:textBox dataSource="{actionForm.foo}" /></code>
- *
- * <p>The <code>dataSource</code> attribute takes either a data binding expression or
+ *
+ * <p> <code><netui:textBox dataSource="{actionForm.foo}" /></code>
+ *
+ * <p>The <code>dataSource</code> attribute takes either a data binding expression or
* the name of a Form Bean property. In the
- * above example, <code><netui:textBox dataSource="foo" /></code>
- * would have the exactly same behavior.
- *
+ * above example, <code><netui:textBox dataSource="foo" /></code>
+ * would have the exactly same behavior.
+ *
* <p>When the tag is used to submit data, the data binding expression must
* refer to a Form Bean property.
- * In cases where the tag is not used to submit data, but is used for
+ * In cases where the tag is not used to submit data, but is used for
* displaying data only, the data
- * binding expression need not refer to a Form Bean property. For example,
- * assume that myIterativeData is a member variable on
+ * binding expression need not refer to a Form Bean property. For example,
+ * assume that myIterativeData is a member variable on
* the Controller file ( = JPF file). The following <netui-data:repeater>
- * tag draws its data from myIterativeData.
- *
+ * tag draws its data from myIterativeData.
+ *
* <p> <code><netui-data:repeater dataSource="{pageFlow.myIterativeData}"></code>
- *
* @jsptagref.databindable Read / Write
- *
* @jsptagref.attributesyntaxvalue <i>expression_datasource</i>
- *
* @netui:attribute required="true"
* description="The <code>dataSource</code> attribute determines both
* the source of populating data for the tag and
@@ -118,7 +113,7 @@
* @return String
*/
protected String doNaming()
- throws JspException
+ throws JspException
{
assert (_dataSource != null) : "dataSource is Null";
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDefaultableDataSourceTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDefaultableDataSourceTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlDefaultableDataSourceTag.java Thu Nov 4 07:35:11 2004
@@ -31,30 +31,25 @@
/**
* Sets the default value (can be an expression).
* @param defaultValue - the default value
- *
- * @jsptagref.attributedescription
- * <p><b>Use in <netui:checkBoxGroup>, <netui:checkBox>,
+ * @jsptagref.attributedescription <p><b>Use in <netui:checkBoxGroup>, <netui:checkBox>,
* <netui:radioButtonGroup>, and <netui:select> tags</b></p>
* <p>Sets the preselected value or values.
- * <p>The <code>defaultValue</code> attribute takes either a String literal or
+ * <p>The <code>defaultValue</code> attribute takes either a String literal or
* a data binding expression.
* <p>If the <code>defaultValue</code> attribute has a String value (or if
- * the data binding expression points to a String), then a single value
- * will be preselected.
+ * the data binding expression points to a String), then a single value
+ * will be preselected.
* <p>If the <code>defaultValue</code> attribute points to a String[] object
* (or any object which can be iterated over), then
* multiple values will be preselected.
- *
- *
+ *
+ *
* <p><b>Use in <netui:textArea> and <netui:textBox> tags</b></p>
* <p>Sets the initial display text.</p>
- * <p>The <code>defaultValue</code> attribute takes either a String literal or
+ * <p>The <code>defaultValue</code> attribute takes either a String literal or
* a data binding expression that points to a String.
- *
* @jsptagref.databindable Read / Write
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_default</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="java.lang.Object"
* description="Sets the default value of the control which is used if the object bound to is null."
* @netui.tldx:attribute
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java Thu Nov 4 07:35:11 2004
@@ -17,10 +17,10 @@
*/
package org.apache.beehive.netui.tags.html;
+import org.apache.beehive.netui.script.common.IDataAccessProvider;
import org.apache.beehive.netui.tags.AbstractClassicTag;
-import org.apache.beehive.netui.tags.IAttributeConsumer;
import org.apache.beehive.netui.tags.ExpressionHandling;
-import org.apache.beehive.netui.script.common.IDataAccessProvider;
+import org.apache.beehive.netui.tags.IAttributeConsumer;
import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.iterator.IteratorFactory;
@@ -310,7 +310,7 @@
* @netui.tldx:attribute language="netuiel"
*/
public void setDataSource(String dataSource)
- throws JspException
+ throws JspException
{
_dataSource = dataSource;
}
@@ -319,7 +319,7 @@
* Gets the tag's data source (can be an expression).
* @return the data source
*/
- public String getDataSource()
+ public String getDataSource()
{
return _dataSource;
}
@@ -376,7 +376,7 @@
return (IDataAccessProvider) findAncestorWithClass(this, IDataAccessProvider.class);
}
- /**
+ /**
* Return an <code>ArrayList</code> which represents a chain of <code>NameInterceptor</code>
* objects. This method by default returns <code>null</code> and should be overridden
* by objects that support naming.
@@ -423,7 +423,7 @@
throws JspException
{
if (defaultValue == null) {
- String s = Bundle.getString("Tags_AttrValueRequired", new Object[] {"defaultValue"});
+ String s = Bundle.getString("Tags_AttrValueRequired", new Object[]{"defaultValue"});
registerTagError(s, null);
return;
}
@@ -450,7 +450,7 @@
throws JspException
{
if (optionsDataSource == null) {
- String s = Bundle.getString("Tags_AttrValueRequired", new Object[] {"optionsDataSource"});
+ String s = Bundle.getString("Tags_AttrValueRequired", new Object[]{"optionsDataSource"});
registerTagError(s, null);
return;
}
@@ -499,7 +499,7 @@
/**
* This will create a new option in the HTML.
*/
- protected void addOption(StringBuilder buffer, String type, String optionValue,
+ protected void addOption(AbstractRenderAppender buffer, String type, String optionValue,
String optionDisplay, int idx, String altText, char accessKey, boolean disabled)
throws JspException
{
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Image.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Image.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Image.java Thu Nov 4 07:35:11 2004
@@ -22,6 +22,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.ImageTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
@@ -35,14 +36,9 @@
/**
* Generates an image with the specified attributes. Image ignores its
* body content.
- *
-
- * @jsptagref.tagdescription
- * Renders an HTML <image> tag with specified attributes.
- *
+ * @jsptagref.tagdescription Renders an HTML <image> tag with specified attributes.
* @example In this sample, an Image shows "friends.jpg" at 150 x 175 pixels, with the id "Friends".
* <pre><netui:image src="friends.jpg" id="Friends" height="150" width="175" /></pre>
- *
* @netui:tag name="image" description="Places an image file type on your page."
* @netui.tldx:tag requiredchild="parameter parameterMap attribute"
* renderer="workshop.netui.jspdesigner.tldx.ImageRenderer"
@@ -97,13 +93,9 @@
/**
* Sets the property to specify where to align the image.
* @param align - the image alignment.
- * @jsptagref.attributedescription
- * The alignment of the image.
- *
+ * @jsptagref.attributedescription The alignment of the image.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_align</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alignment of the image."
* @netui.tldx:attribute
@@ -116,13 +108,9 @@
/**
* Sets the property to specify the alt text of the image.
* @param alt - the image alignment.
- * @jsptagref.attributedescription
- * The alternative text of the image
- *
+ * @jsptagref.attributedescription The alternative text of the image
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alternative text of the image."
* @netui.tldx:attribute
@@ -143,16 +131,13 @@
{
_state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, LONGDESC, longdesc);
}
+
/**
* Sets the border size around the image.
* @param border - the border size.
- * @jsptagref.attributedescription
- * The border size around the image
- *
+ * @jsptagref.attributedescription The border size around the image
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>integer_pixelBorder</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The border size around the image."
* @netui.tldx:attribute
@@ -165,32 +150,24 @@
/**
* Sets the image height.
* @param height - the height.
- * @jsptagref.attributedescription
- * The image height
- *
+ * @jsptagref.attributedescription The image height
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_height</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image height."
* @netui.tldx:attribute
*/
public void setHeight(String height)
{
- _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HEIGHT, height);
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HEIGHT, height);
}
/**
* Sets the the horizontal spacing around the image.
* @param hspace - the horizontal spacing.
- * @jsptagref.attributedescription
- * The horizontal spacing around the image.
- *
+ * @jsptagref.attributedescription The horizontal spacing around the image.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_hspace</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The horizontal spacing around the image."
* @netui.tldx:attribute
@@ -203,13 +180,9 @@
/**
* Sets the server-side image map declaration.
* @param ismap - the image map declaration.
- * @jsptagref.attributedescription
- * The server-side map declaration.
- *
+ * @jsptagref.attributedescription The server-side map declaration.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_isMap</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The server-side map declaration."
* @netui.tldx:attribute category="misc"
@@ -222,13 +195,9 @@
/**
* Sets the location hash to append to the url.
* @param location - the location hash.
- * @jsptagref.attributedescription
- * The location hash to append to the URL.
- *
+ * @jsptagref.attributedescription The location hash to append to the URL.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_location</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The location hash to append to the URL."
* @netui.tldx:attribute category="misc"
@@ -241,13 +210,9 @@
/**
* Sets the image source URI.
* @param src - the source URI.
- * @jsptagref.attributedescription
- * The image source URI
- *
+ * @jsptagref.attributedescription The image source URI
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_src</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image source URI"
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass" reftype="img-url"
@@ -258,16 +223,12 @@
_state.src = src;
}
- /**
+ /**
* Sets the client-side image map declaration.
* @param usemap - the map declaration.
- * @jsptagref.attributedescription
- * The client-side image map declaration
- *
+ * @jsptagref.attributedescription The client-side image map declaration
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_useMap</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The client-side image map declaration"
* @netui.tldx:attribute category="misc"
@@ -280,13 +241,9 @@
/**
* Sets the vertical spacing around the image.
* @param vspace - the vertical spacing.
- * @jsptagref.attributedescription
- * The vertical spacing around the image.
- *
+ * @jsptagref.attributedescription The vertical spacing around the image.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_vspace</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The vertical spacing around the image."
* @netui.tldx:attribute
@@ -299,13 +256,9 @@
/**
* Sets the image width.
* @param width - the image width.
- * @jsptagref.attributedescription
- * The image width.
- *
+ * @jsptagref.attributedescription The image width.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_pixelWidth</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image width."
* @netui.tldx:attribute
@@ -348,7 +301,7 @@
String scriptId = null;
// Generate the name definition or image element
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
// the src attribute
String srcurl = url(_state.src);
@@ -373,15 +326,16 @@
_state.id = _id;
}
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.IMAGE_TAG, req);
- br.doStartTag(results, _state);
- br.doEndTag(results);
+ br.doStartTag(writer, _state);
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
// Evaluate the remainder of this page
localRelease();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java Thu Nov 4 07:35:11 2004
@@ -22,9 +22,9 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.ImageTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
-import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
@@ -41,10 +41,7 @@
* <li>linkName - an internal place in the page to move to</li>
* <li>page - The module-relative page URL to which this hyperlink will be rendered.</li>
* </ul>
- *
-
- * @jsptagref.tagdescription
- * <p>
+ * @jsptagref.tagdescription <p>
* Generates a hyperlink with a clickable image. Provides support for image rollovers.
* <p>
* The <netui:imageAnchor> tag must have one of five attributes to correctly create the hyperlink:
@@ -57,20 +54,20 @@
* <li><code>page</code> - the module-relative page URL to which this hyperlink will be rendered</li>
* </ul>
* </blockquote>
- *
+ *
* <p><b>JavaScript</b></p>
* <p>If an <netui:imageAnchor> sets the <code>formSubmit</code> attribute to <code>true</code> and no
* <code>onClick</code> attribute is set, the following JavaScript function will be written into the page.
- * The JavaScript function will be referenced by the <code>onclick</code> attribute of the generated image
+ * The JavaScript function will be referenced by the <code>onclick</code> attribute of the generated image
* anchor, and will cause the parent form to submit:<br/>
* <pre> function submit[formname][formAction]Form() {
* for(var i=0; i<document.forms.length; i++) {
* if (document.forms[i].id == "[formAction]") {
* document.forms[i].method = "POST";
* document.forms[i].action = "[formAction]";
- * document.forms[i].submit();
- * }
- * }
+ * document.forms[i].submit();
+ * }
+ * }
* }
* </pre>
* <p>It is possible to write a custom <code>onClick</code> JavaScript event handler that would
@@ -80,32 +77,29 @@
* <pre> <netui:imageAnchor formSubmit="true" <b>onClick="SubmitFromAnchor();return false;"</b>>
* View Results
* </netui:imageAnchor></pre>
- *
+ *
* <p>And add the referenced JavaScript function to the page:</p>
- * <pre> function SubmitFromAnchor()
- * {
+ * <pre> function SubmitFromAnchor()
+ * {
* // implement custom logic here
*
- * for(var i=0; i<document.forms.length; i++)
- * {
+ * for(var i=0; i<document.forms.length; i++)
+ * {
* // submit to the action /aWebapp/formPost.do
- * if (document.forms[i].action == "/aWebapp/formPost.do")
- * {
- * document.forms[i].method="POST";
- * document.forms[i].action="/aWebapp/formPost.do";
- * document.forms[i].submit();
- * }
- * }
+ * if (document.forms[i].action == "/aWebapp/formPost.do")
+ * {
+ * document.forms[i].method="POST";
+ * document.forms[i].action="/aWebapp/formPost.do";
+ * document.forms[i].submit();
+ * }
+ * }
* }</pre>
- *
+ *
* <p>This will cause the JavaScript function to be executed before posting the form.</p>
- *
- * @example
- * In this sample, an <netui:imageAnchor> shows "top.jpg" at 25 x 25 pixels and navigates to
+ * @example In this sample, an <netui:imageAnchor> shows "top.jpg" at 25 x 25 pixels and navigates to
* index.jsp when clicked.
* <pre> <netui:imageAnchor href="index.jsp" src="top.jpg" height="25" width="25" /></pre>
* </p>
- *
* @netui:tag name="imageAnchor" description="Combines the functionality of the netui:image and netui:anchor tags."
* @netui.tldx:tag requiredchild="parameter parameterMap attribute"
* renderer="workshop.netui.jspdesigner.tldx.ImageAnchorRenderer"
@@ -158,13 +152,9 @@
/**
* Sets the property to specify where to align the image.
* @param align - the image alignment.
- * @jsptagref.attributedescription
- * The alignment of the image.
- *
+ * @jsptagref.attributedescription The alignment of the image.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_align</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alignment of the image."
* @netui.tldx:attribute
@@ -177,13 +167,9 @@
/**
* Sets the property to specify the alt text of the image.
* @param alt - the image alignment.
- * @jsptagref.attributedescription
- * The alternative text of the image
- *
+ * @jsptagref.attributedescription The alternative text of the image
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alternative text of the image."
* @netui.tldx:attribute
@@ -211,16 +197,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
- * H, V, left arrow, and right arrow</code>
- *
+ * are often used by browsers: <code>A, C, E, F, G,
+ * H, V, left arrow, and right arrow</code>
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -235,13 +217,9 @@
/**
* Sets the border size around the image.
* @param border - the border size.
- * @jsptagref.attributedescription
- * The border size around the image
- *
+ * @jsptagref.attributedescription The border size around the image
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>integer_pixelBorder</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The border size around the image."
* @netui.tldx:attribute
@@ -254,13 +232,9 @@
/**
* Sets the image height.
* @param height - the height.
- * @jsptagref.attributedescription
- * The image height
- *
+ * @jsptagref.attributedescription The image height
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_height</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image height."
* @netui.tldx:attribute
@@ -273,13 +247,9 @@
/**
* Sets the the horizontal spacing around the image.
* @param hspace - the horizontal spacing.
- * @jsptagref.attributedescription
- * The horizontal spacing around the image.
- *
+ * @jsptagref.attributedescription The horizontal spacing around the image.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_hspace</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The horizontal spacing around the image."
* @netui.tldx:attribute category="misc"
@@ -292,13 +262,9 @@
/**
* Sets the server-side image map declaration.
* @param ismap - the image map declaration.
- * @jsptagref.attributedescription
- * The server-side map declaration.
- *
+ * @jsptagref.attributedescription The server-side map declaration.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_isMap</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The server-side map declaration."
* @netui.tldx:attribute category="misc"
@@ -311,13 +277,9 @@
/**
* Sets the roll-over image of the ImageAnchor.
* @param rolloverImage - the rollover image.
- * @jsptagref.attributedescription
- * The URI of the rollover image.
- *
+ * @jsptagref.attributedescription The URI of the rollover image.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_rolloverImage</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The URI of the rollover image."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass"
@@ -330,13 +292,9 @@
/**
* Sets the image source URI.
* @param src - the image source URI.
- * @jsptagref.attributedescription
- * The image source URI
- *
+ * @jsptagref.attributedescription The image source URI
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_src</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image source URI"
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass"
@@ -351,13 +309,9 @@
/**
* Sets the client-side image map declaration.
* @param usemap - the map declaration.
- * @jsptagref.attributedescription
- * The client-side image map declaration
- *
+ * @jsptagref.attributedescription The client-side image map declaration
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_useMap</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The client-side image map declaration"
* @netui.tldx:attribute category="misc"
@@ -367,16 +321,12 @@
_imgState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, USEMAP, usemap);
}
- /**
+ /**
* Sets the vertical spacing around the image.
* @param vspace - the vertical spacing.
- * @jsptagref.attributedescription
- * The vertical spacing around the image.
- *
+ * @jsptagref.attributedescription The vertical spacing around the image.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_vspace</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The vertical spacing around the image."
* @netui.tldx:attribute
@@ -419,13 +369,9 @@
/**
* Sets the image width.
* @param width - the image width.
- * @jsptagref.attributedescription
- * The image width.
- *
+ * @jsptagref.attributedescription The image width.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_pixelWidth</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image width."
* @netui.tldx:attribute
@@ -470,12 +416,13 @@
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// build the anchor into the results
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
StringBuilder script = new StringBuilder(128);
// render the anchor tag
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase trb = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, req);
- if (!createAnchorBeginTag(req, results, script, trb)) {
+ if (!createAnchorBeginTag(req, script, trb)) {
reportErrors();
if (script.length() > 0)
write(script.toString());
@@ -505,15 +452,15 @@
// render the image tag.
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.IMAGE_TAG, req);
- br.doStartTag(results, _imgState);
- br.doEndTag(results);
+ br.doStartTag(writer, _imgState);
+ br.doEndTag(writer);
// write the end tag
- trb.doEndTag(results);
+ trb.doEndTag(writer);
if (script.length() > 0)
- results.append(script.toString());
+ write(script.toString());
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageButton.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageButton.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageButton.java Thu Nov 4 07:35:11 2004
@@ -22,6 +22,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.InputImageTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.struts.Globals;
import org.apache.struts.config.ModuleConfig;
@@ -33,28 +34,22 @@
/**
* Generates an <code><input type="image"></code> tag with the specified attributes. ImageButton
* ignores its body content.
+ * @jsptagref.tagdescription Renders an <code><input type="image"></code> tag with the specified attributes.
*
-
- * @jsptagref.tagdescription
- * Renders an <code><input type="image"></code> tag with the specified attributes.
- *
* <p><b>JavaScript</b></p>
* <p>If the <netui:imageButton> specifies
* a <code>rolloverImage</code> attribute, the following JavaScript will be written to the page:</p>
- * <pre> function swapImage(control, image)
+ * <pre> function swapImage(control, image)
* {
* control.src = image;
* }</pre>
- *
- * @example
- * In this sample, an <netui:imageButton> tag displays the image "house.jpg".
+ * @example In this sample, an <netui:imageButton> tag displays the image "house.jpg".
* On mouseover, the image "house_highlight.jpg" is displayed.
- * When clicked, the <netui:imageButton> will invoke the action specified by its parent
+ * When clicked, the <netui:imageButton> will invoke the action specified by its parent
* <netui:form> tag.
* <pre> <netui:form action="formSubmit">
* <netui:imageButton rolloverImage="house_highlight.jpg" src="house.jpg" />
* </netui:form></pre>
- *
* @netui:tag name="imageButton" description="Combines the functionality of the netui:image and netui:button tags."
* @netui.tldx:tag requiredchild="attribute"
* renderer="workshop.netui.jspdesigner.tldx.ImageButtonRenderer"
@@ -117,13 +112,9 @@
/**
* Sets the property to specify where to align the image.
* @param align - the image alignment.
- * @jsptagref.attributedescription
- * The alignment of the image.
- *
+ * @jsptagref.attributedescription The alignment of the image.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_align</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="Sets the property to specify where to align the image."
* @netui.tldx:attribute
@@ -139,16 +130,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -164,14 +151,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key."
@@ -194,7 +177,7 @@
_state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, USEMAP, usemap);
}
- /**
+ /**
* Sets the ismap of for the map.
* @param ismap - the tab index.
* @netui:attribute required="false" rtexprvalue="true"
@@ -209,13 +192,9 @@
/**
* Sets the property to specify the alt text of the image.
* @param alt - the image alt text.
- * @jsptagref.attributedescription
- * The alternative text of the image
- *
+ * @jsptagref.attributedescription The alternative text of the image
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alternative text of the image"
* @netui.tldx:attribute
@@ -224,16 +203,13 @@
{
_state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, alt);
}
+
/**
* Sets the roll-over image of the ImageAnchor.
* @param rolloverImage - the rollover image.
- * @jsptagref.attributedescription
- * The URI of the rollover image.
- *
+ * @jsptagref.attributedescription The URI of the rollover image.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_rolloverImage</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The URI of the rollover image."
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass"
@@ -246,13 +222,9 @@
/**
* Sets the image source URI.
* @param src - the source URI.
- * @jsptagref.attributedescription
- * The image source URI
- *
+ * @jsptagref.attributedescription The image source URI
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_src</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The image source URI"
* @netui.tldx:attribute propertyclass="workshop.jspdesigner.properties.URIPropertyClass"
@@ -267,13 +239,9 @@
/**
* Set the value of the ImageButton.
* @param value - the value of the ImageButton.
- * @jsptagref.attributedescription
- * The value of the image button.
- *
+ * @jsptagref.attributedescription The value of the image button.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_value</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The value of the image button."
* @netui.tldx:attribute
@@ -323,7 +291,7 @@
ServletRequest req = pageContext.getRequest();
String scriptId = null;
String tmp = null;
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
// we assume that tagId will over have override id if both
// are defined.
@@ -361,14 +329,15 @@
setOnMouseOver("swapImage(this,'" + _rolloverImage + "')");
}
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_IMAGE_TAG, req);
- br.doStartTag(results, _state);
- br.doEndTag(results);
+ br.doStartTag(writer, _state);
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
// Evaluate the remainder of this page
localRelease();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java Thu Nov 4 07:35:11 2004
@@ -208,7 +208,8 @@
private static ResourceBundle getBundle()
{
if (_bundle == null)
- _bundle = ResourceBundle.getBundle(BUNDLE_NAME);;
+ _bundle = ResourceBundle.getBundle(BUNDLE_NAME);
+ ;
return _bundle;
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Label.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Label.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Label.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.LabelTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
@@ -28,9 +29,7 @@
import javax.servlet.jsp.JspException;
/**
- * @jsptagref.tagdescription
- * Associates text with an input element in a {@link Form}.
- *
+ * @jsptagref.tagdescription Associates text with an input element in a {@link Form}.
* @netui:tag name="label" description="a <label> element which may point to a form control."
* @netui.tldx:tag requiredchild="formatDate formatNumber formatString"
* renderer="workshop.netui.jspdesigner.tldx.FormLabelRenderer"
@@ -113,7 +112,7 @@
usingDefault = true;
}
- StringBuilder results = new StringBuilder(64);
+ //StringBuilder results = new StringBuilder(64);
// we assume that tagId will over have override id if both
// are defined.
@@ -124,29 +123,30 @@
_state.id = realName;
}
- TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.LABEL_TAG, req);
- br.doStartTag(results, _state);
+ if (hasErrors()) {
+ reportErrors();
+ localRelease();
+ return EVAL_PAGE;
+ }
+
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.LABEL_TAG, req);
+ br.doStartTag(writer, _state);
// push the evaluated expression when we are not client side bound...
if (!usingDefault)
labelValue = formatText(labelValue);
- if (!bypassEscape)
- results.append(filter(labelValue, _escapeWhiteSpace));
+ if (!bypassEscape)
+ write(filter(labelValue, _escapeWhiteSpace));
else
- results.append(labelValue);
- br.doEndTag(results);
-
- if (hasErrors()) {
- reportErrors();
- localRelease();
- return EVAL_PAGE;
- }
+ write(labelValue);
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java Thu Nov 4 07:35:11 2004
@@ -96,7 +96,8 @@
* Indicate that a formatter has reported an error so the formatter should output it's
* body text.
*/
- public void formatterHasError() {
+ public void formatterHasError()
+ {
_formatterErrors = true;
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java Thu Nov 4 07:35:11 2004
@@ -30,27 +30,20 @@
/**
* Writes a URL parameter to a URL on its parent tag. The parent tag must implement URLParams.
+ * @jsptagref.tagdescription Writes a name/value pair to the URL or the parent tag.
*
-
- * @jsptagref.tagdescription
- *
- * Writes a name/value pair to the URL or the parent tag.
- *
* You can dynamically determine the value of the <netui:parameter> through
- * the <code>value</code> attribute.
- *
- * @example
- * In this sample, the hyperlink is amended with the parameter <code>q=Socrates</code>
- *
+ * the <code>value</code> attribute.
+ * @example In this sample, the hyperlink is amended with the parameter <code>q=Socrates</code>
+ *
* <pre> <netui:anchor href="http://www.google.com/search">
* Search Google with the query "Socrates"
* <netui:parameter name="q" value="Socrates" />
* </netui:anchor></pre>
*
* The URL produced appears below:
- *
+ *
* <pre> http://www.google.com/search?q=Socrates</pre>
- *
* @netui:tag name="parameter" description="Writes a URL parameter to a URL on its parent tag."
* @netui.tldx:tag requiredparent="anchor button form image imageAnchor data:anchorColumn"
* requiredchild="#nothing"
@@ -75,13 +68,9 @@
/**
* Sets the name of the URL parameter.
* @param name - the parameter name.
- * @jsptagref.attributedescription
- * The name of the parameter.
- *
+ * @jsptagref.attributedescription The name of the parameter.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_name</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The name of the parameter."
*/
@@ -93,13 +82,9 @@
/**
* Sets the value of the URL parameter. This can be an expression.
* @param value - the parameter value.
- * @jsptagref.attributedescription
- * The value of the parameter. May be a literal or a data binding expression.
- *
+ * @jsptagref.attributedescription The value of the parameter. May be a literal or a data binding expression.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_value</i>
- *
* @netui:attribute required="true" rtexprvalue="true" type="java.lang.Object"
* description="The value of the parameter."
* @netui.tldx:attribute
@@ -116,7 +101,7 @@
*/
public int doStartTag() throws JspException
{
- JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this,URLParams.class);
+ JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, URLParams.class);
if (parentTag == null) {
String msg = Bundle.getString("Tags_InvalidParameterParent");
registerTagError(msg, null);
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java Thu Nov 4 07:35:11 2004
@@ -30,41 +30,35 @@
/**
* Writes each in a map of URL parameters to a URL on its parent tag.
* The parent tag must implement URLParams.
+ * @jsptagref.tagdescription <p>Writes a group of name/value pairs to the URL or the parent tag.
*
-
- * @jsptagref.tagdescription
- * <p>Writes a group of name/value pairs to the URL or the parent tag.
- *
- * <p>The <netui:parameterMap> can be nested inside of the
+ * <p>The <netui:parameterMap> can be nested inside of the
* {@link org.apache.beehive.netui.tags.html.Anchor},
* {@link org.apache.beehive.netui.tags.html.Button},
* {@link org.apache.beehive.netui.tags.html.Form}, and
* {@link org.apache.beehive.netui.tags.html.Image} tags.
- *
+ *
* <p>You can dynamically determine the value of the <netui:parameterMap> tag by pointing
* the <code>map</code> attribute at a {@link java.util.HashMap java.util.HashMap} object.
- *
- * @example
- * Assume that there is a java.util.HashMap
+ * @example Assume that there is a java.util.HashMap
* object in the Controller file.
- *
+ *
* <pre> public HashMap hashMap = new HashMap();
* hashMap.put("q", "Socrates");
* hashMap.put("lr", "lang_el");
* hashMap.put("as_qdr", "m3");</pre>
- *
- * <p>The following set of tags will read the HashMap object and generate a
- * link with a set of URL parameters.
- *
+ *
+ * <p>The following set of tags will read the HashMap object and generate a
+ * link with a set of URL parameters.
+ *
* <pre> <netui:anchor href="http://www.google.com/search">
* Search Greek language web sites updated in the last three months with the query "Socrates".
* <netui:parameterMap map="{pageFlow.hashMap}"/>
* </netui:anchor></pre>
- *
+ *
* <p>The URL produced appears as follows:
- *
+ *
* <pre> http://www.google.com/search?lr=lang_el&q=Socrates&as_qdr=m3</pre>
- *
* @netui:tag name="parameterMap" description="Uses a JSP 2.0 expression that points to a map of parameters. Each entry in the map provides a URL parameter that will be added to the parent tag's URL."
* @netui.tldx:tag requiredparent="anchor button form image imageAnchor data:anchorColumn"
* requiredchild="#nothing"
@@ -88,17 +82,13 @@
/**
* Sets the map expression.
* @param map - the map expression.
- * @jsptagref.attributedescription
- * A data binding expression pointing to a {@link java.util.Map java.util.Map} of parameters.
+ * @jsptagref.attributedescription A data binding expression pointing to a {@link java.util.Map java.util.Map} of parameters.
* The expression can point at any implementation of the java.util.Map interface,
- * including {@link java.util.AbstractMap java.util.AbstractMap},
- * {@link java.util.HashMap java.util.HashMap},
+ * including {@link java.util.AbstractMap java.util.AbstractMap},
+ * {@link java.util.HashMap java.util.HashMap},
* {@link java.util.Hashtable java.util.Hashtable}, etc.
- *
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_mapObject</i>
- *
* @netui:attribute required="true" rtexprvalue="true" type="java.util.Map"
* description="A JSP 2.0 EL expression pointing to a java.util.Map of parameters."
* @netui.tldx:attribute
@@ -114,7 +104,7 @@
*/
public int doStartTag() throws JspException
{
- Tag parentTag = findAncestorWithClass(this,URLParams.class);
+ Tag parentTag = findAncestorWithClass(this, URLParams.class);
if (parentTag != null) {
// this map shouldn't be null because the attribute is required.
// @todo: when Asserts are on, we should assert this instead of this conditional
@@ -123,7 +113,7 @@
Iterator it = _map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry key = (Map.Entry) it.next();
- parent.addParameter(key.getKey().toString(),key.getValue().toString());
+ parent.addParameter(key.getKey().toString(), key.getValue().toString());
}
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java Thu Nov 4 07:35:11 2004
@@ -22,7 +22,9 @@
import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor;
import org.apache.beehive.netui.tags.naming.IndexedNameInterceptor;
import org.apache.beehive.netui.tags.naming.PrefixNameInterceptor;
+import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.util.tags.GroupOption;
@@ -36,81 +38,78 @@
*
* If RadioButtonGroup uses any Format tags, it must have those tags come before above any nested
* RadioButtonOption tags.
- *
-
- * @jsptagref.tagdescription
- * Renders a collection of radiobutton options
+ * @jsptagref.tagdescription Renders a collection of radiobutton options
* and handles the data binding of their values.
- *
- * <p>The <netui:radioButtonGroup> tag can generate a set of
+ *
+ * <p>The <netui:radioButtonGroup> tag can generate a set of
* radiobutton options in two ways:
- *
+ *
* <blockquote>
* <ol>
- * <li>they can be dynamically generated by pointing the
+ * <li>they can be dynamically generated by pointing the
* <netui:radioButtonGroup> tag at a {@link java.util.HashMap java.util.HashMap}
* or String[] object</li>
- * <li>they can be statically generated by providing a set of children
+ * <li>they can be statically generated by providing a set of children
* {@link RadioButtonOption}
* tags</li>
* </ol>
* </blockquote>
- *
+ *
* <p><b>Dynamically Generated Radiobutton Options</b>
- *
+ *
* <p>You can dynamically generate a set of radionbutton options by
- * pointing the <netui:radioButtonGroup> tag at a HashMap
+ * pointing the <netui:radioButtonGroup> tag at a HashMap
* (or any object that implements the {@link java.util.Map java.util.Map} interface).
- *
+ *
* <pre> public HashMap hashMap = new HashMap();
* hashMap.put("value1", "Display Text 1");
* hashMap.put("value2", "Display Text 2");
* hashMap.put("value3", "Display Text 3");</pre>
- *
+ *
* <p>To point the <netui:radioButtonGroup>
* at the Map object use the <code>optionsDataSource</code> attribute.
- *
+ *
* <pre> <netui:radioButtonGroup
* optionsDataSource="{pageFlow.hashMap}"></pre>
- *
- * <p>In the generated radiobutton options, the display text and the
- * submitted value can be made to differ. The HashMap keys will
+ *
+ * <p>In the generated radiobutton options, the display text and the
+ * submitted value can be made to differ. The HashMap keys will
* form the submitted values, while the HashMap entries will form
- * the display texts.
- *
+ * the display texts.
+ *
* <pre> <input type="radio" value="value1">Display Text 1</input>
* <input type="radio" value="value2">Display Text 2</input>
* <input type="radio" value="value3">Display Text 3</input></pre>
- *
- * <p>Note that you can point the <netui:radioButtonGroup> tag at a
- * String[] object. A set of radiobutton options will be generated,
- * but there will be no difference between the
+ *
+ * <p>Note that you can point the <netui:radioButtonGroup> tag at a
+ * String[] object. A set of radiobutton options will be generated,
+ * but there will be no difference between the
* display texts and the submitted values.
- *
+ *
* <p><b>Statically Generated Radiobutton Options</b></p>
- *
+ *
* <p>To statically generate radiobutton options, place a set of <netui:radioButtonOption> tags inside
* the <netui:radioButtonGroup> tag.
- *
+ *
* <pre> <netui:radioButtonGroup dataSource="{actionForm.selection}">
* <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br>
* </netui:radioButtonGroup></pre>
- *
+ *
* <p><b>Submitting Radionbutton Options</b></p>
- *
+ *
* <p>A <netui:radioButtonGroup> is submitted as a String value. Use the <code>dataSource</code> attribute
* to submit to a String object.
- *
+ *
* <pre> <netui:radioButtonGroup dataSource="{actionForm.selection}"></pre>
- *
+ *
* <p>In this case, the <netui:radioButtonGroup> submits to a String field of a Form Bean.
- *
+ *
* <pre> public static class ProcessDataForm extends FormData
* {
* private String selection;
- *
+ *
* public void setSelection(String selection)
* {
* this.selection = selection;
@@ -121,15 +120,13 @@
* return this.selection;
* }
* }</pre>
- *
- * @example
- * In this sample, a <netui:radioButtonGroup> tag draws a set of options from a HashMap object.
+ * @example In this sample, a <netui:radioButtonGroup> tag draws a set of options from a HashMap object.
* <pre> <netui:radioButtonGroup
* optionsDataSource="{pageFlow.hashMap}"
* dataSource="{actionForm.selection}" /></pre>
- *
+ *
* Assuming that the <code>optionsDataSource</code> attribute refers to the following HashMap object...
- *
+ *
* <pre> public HashMap hashMap = new HashMap();
* protected void onCreate()
* {
@@ -139,13 +136,12 @@
* }</pre>
*
* ...then the following HTML will be generated in the browser...
- *
+ *
* <pre> <netui:radioButtonGroup dataSource="{actionForm.selection}">
* <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br>
* </netui:radioButtonGroup></pre>
- *
* @netui:tag name="radioButtonGroup" description="Defines a group of netui:radioButtonOption elements."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.RadioButtonGroupRenderer" whitespace="indent"
*/
@@ -274,9 +270,10 @@
ServletRequest req = pageContext.getRequest();
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
- StringBuilder results = new StringBuilder(64);
+ //StringBuilder results = new StringBuilder(64);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (isVertical()) {
- _cr.TABLE(results);
+ _cr.TABLE(writer);
}
// if this is a repeater then we shouid prime the pump...
@@ -297,12 +294,13 @@
break;
}
if (isVertical())
- _cr.TR_TD(results);
+ _cr.TR_TD(writer);
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
}
- write(results.toString());
- _saveBody = new StringBuilder(128);
+ //write(results.toString());
+ // This is basically this is if enough for 5 options
+ _saveBody = new StringBuilder(640);
return EVAL_BODY_INCLUDE;
}
@@ -313,6 +311,7 @@
*/
public int doAfterBody() throws JspException
{
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(_saveBody);
if (bodyContent != null) {
String value = bodyContent.getString();
bodyContent.clearBody();
@@ -324,16 +323,16 @@
if (_repeater) {
ServletRequest req = pageContext.getRequest();
if (_cr == null)
- _cr = TagRenderingBase.Factory.getConstantRendering(req);
+ _cr = TagRenderingBase.Factory.getConstantRendering(req);
if (isVertical())
- _cr.end_TD_TR(_saveBody);
+ _cr.end_TD_TR(writer);
while (((Iterator) _dyanmicAttrs).hasNext()) {
_repCurItem = ((Iterator) _dyanmicAttrs).next();
if (_repCurItem != null) {
_repIdx++;
if (isVertical())
- _cr.TR_TD(_saveBody);
+ _cr.TR_TD(writer);
return EVAL_BODY_AGAIN;
}
}
@@ -361,20 +360,21 @@
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (_saveBody != null)
- results.append(_saveBody);
+ write(_saveBody.toString());
// if this is a repeater we output the content during the body processing
if (_repeater) {
// Render a tag representing the end of our current form
if (isVertical())
- _cr.end_TABLE(results);
+ _cr.end_TABLE(writer);
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -394,13 +394,13 @@
optionDisplay = "";
}
- addOption(results, INPUT_RADIO, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
+ addOption(writer, INPUT_RADIO, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
- results.append("\n");
+ write("\n");
}
}
@@ -416,29 +416,29 @@
if (o instanceof GroupOption) {
GroupOption go = (GroupOption) o;
- addOption(results, INPUT_RADIO, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
+ addOption(writer, INPUT_RADIO, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
}
else {
String radioValue = o.toString();
- addOption(results, INPUT_RADIO, radioValue, radioValue, idx++, altText, accessKey, _disabled);
+ addOption(writer, INPUT_RADIO, radioValue, radioValue, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
- results.append("\n");
+ write("\n");
}
}
if (isVertical()) {
- _cr.end_TABLE(results);
+ _cr.end_TABLE(writer);
}
if (idScript != null)
- results.append(idScript);
+ write(idScript);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -449,9 +449,9 @@
protected void localRelease()
{
// remove the context allowing binding to container.item during binding
- if(_repeater)
+ if (_repeater)
DataAccessProviderStack.removeDataAccessProvider(pageContext);
-
+
super.localRelease();
_match = null;
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonOption.java Thu Nov 4 07:35:11 2004
@@ -27,25 +27,19 @@
/**
* A radio button whose state is determined by its enclosing RadioButtonGroup.
+ * @jsptagref.tagdescription Generates a single radiobutton option in a group of options.
*
-
- * @jsptagref.tagdescription
- * Generates a single radiobutton option in a group of options.
- *
* <p>The <radioButtonOption> tag must have a parent {@link RadioButtonGroup} tag.
- *
- * @example
- * In this example, three radiobuttons are generated in the browser.
- *
+ * @example In this example, three radiobuttons are generated in the browser.
+ *
* <pre> <netui:form action="processData">
* <netui:radioButtonGroup dataSource="{actionForm.selection}">
* <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br>
* <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br>
- * </netui:radioButtonGroup>
+ * </netui:radioButtonGroup>
* <netui:button value="Submit" />
* </netui:form></pre>
- *
* @netui:tag name="radioButtonOption" description="A radio button whose state is determined by its enclosing netui:RadioButtonGroup."
* @netui.tldx:tag requiredparent="radioButtonGroup td"
* renderer="workshop.netui.jspdesigner.tldx.RadioButtonOptionRenderer"
@@ -104,13 +98,9 @@
* Set the label style for each contained RadioButtonOption.
* The label style here will override a labelStyle at the RadioButtonGroup level.
* @param labelStyle - the label style
- * @jsptagref.attributedescription
- * The style of the label for each contained <netui:radioButtonOption> tag.
- *
+ * @jsptagref.attributedescription The style of the label for each contained <netui:radioButtonOption> tag.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_labelStyle</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The style of the label for each contained <netui:radioButtonOption> tag."
* @netui.tldx:attribute category="format" propertyclass="workshop.jspdesigner.properties.JspStyleProperty"
@@ -124,13 +114,9 @@
* Set the label style class for each contained RadioButtonOption.
* The label style class here will override a labelStyleClass at the RadioButtonGroup level.
* @param labelStyleClass - the label style
- * @jsptagref.attributedescription
- * The class of the labels for each contained <netui:radioButtonOption> tag.
- *
+ * @jsptagref.attributedescription The class of the labels for each contained <netui:radioButtonOption> tag.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_class</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The class of the labels for each contained <netui:radioButtonOption> tag."
* @netui.tldx:attribute category="format"
@@ -143,13 +129,9 @@
/**
* Set the value of this RadioButtonOption.
* @param value - the RadioButtonOption value
- * @jsptagref.attributedescription
- * A literal or data binding expression.
- *
+ * @jsptagref.attributedescription A literal or data binding expression.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_or_expression_value</i>
- *
* @netui:attribute required="true" rtexprvalue="true" type="java.lang.Object"
* description="The value of the option."
* @netui.tldx:attribute
@@ -213,7 +195,7 @@
{
if (hasErrors())
return reportAndExit(EVAL_PAGE);
-
+
ServletRequest req = pageContext.getRequest();
ConstantRendering cr = TagRenderingBase.Factory.getConstantRendering(req);
@@ -223,9 +205,10 @@
boolean repeat = parent.isRepeater();
// Generate an HTML <input type='radio'> element
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (parent.isVertical()) {
- cr.TR_TD(results);
+ cr.TR_TD(writer);
}
_state.type = INPUT_RADIO;
_state.name = parent.getQualifiedDataSourceName();
@@ -237,11 +220,11 @@
_state.disabled = parent.isDisabled();
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
// if this is in a repeater, then we only output the <input tag>
if (repeat) {
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
}
@@ -254,18 +237,18 @@
}
TagRenderingBase spanTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
- spanTag.doStartTag(results, _spanState);
+ spanTag.doStartTag(writer, _spanState);
if (_text == null)
- results.append(_state.value);
+ write(_state.value);
else
- results.append(_text);
- spanTag.doEndTag(results);
+ write(_text);
+ spanTag.doEndTag(writer);
if (parent.isVertical()) {
- cr.end_TD_TR(results);
+ cr.end_TD_TR(writer);
}
- write(results.toString());
+ //write(results.toString());
// Continue evaluating this page
localRelease();
@@ -298,16 +281,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description=" The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -323,13 +302,9 @@
/**
* Sets the alt attribute value.
* @param alt - the alt value.
- * @jsptagref.attributedescription
- * The alt attribute of the element.
- *
+ * @jsptagref.attributedescription The alt attribute of the element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alt attribute of the element."
* @netui.tldx:attribute category="misc"
@@ -342,14 +317,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java Thu Nov 4 07:35:11 2004
@@ -26,26 +26,20 @@
* rewritting. Some containers such as WebLogic Portal rewrite names so they are unique.
* This tag will cause the name to be made available from <code>getNetuiTagName</code>
* JavaScript, which is output from the <netui:html> tag.
- *
-
- * @jsptagref.tagdescription
- * Allows a name, typically either an <code>id</code> or <code>name</code> attribute,
+ * @jsptagref.tagdescription Allows a name, typically either an <code>id</code> or <code>name</code> attribute,
* to participate in URL
- * rewritting. Some containers such as WebLogic Portal rewrite name attributes
+ * rewritting. Some containers such as WebLogic Portal rewrite name attributes
* so they are unique.
* This tag will cause the name to be made available from the <code>getNetuiTagName( tagId, tag )</code>
* JavaScript function.
- *
- * @example
- * In this sample, we are settting the id attribute of the span tag to 'foo'. The
- * actual value that will be rendered in the HTML may change depending on the
+ * @example In this sample, we are settting the id attribute of the span tag to 'foo'. The
+ * actual value that will be rendered in the HTML may change depending on the
* container where the web application resides. For example, a Portal container may change
- * render <span name="scope1_foo"> instead of <span name="scope1_foo">.
+ * render <span name="scope1_foo"> instead of <span name="scope1_foo">.
* But the value 'foo' can be passed to <code>getNetuiTagName( tagId, tag )</code> to find the rendered
* value of the name attribute.
- *
- * <pre> <span id="<netui:rewriteName name="foo"/>"></pre>
- *
+ *
+ * <pre> <span id="<netui:rewriteName name="foo"/>"></pre>
* @netui:tag name="rewriteName" description="Allows the URL Rewriter to rewrite the name attribute before it is output into the HTML stream."
* @netui.tldx:tag requiredchild="#nothing"
* renderer="workshop.netui.jspdesigner.tldx.RewriteNameRenderer"
@@ -69,13 +63,9 @@
/**
* Sets the name to be rewritten.
* @param name - the parameter name.
- * @jsptagref.attributedescription
- * The name which will be rewritten. This value will be output to the page rendered in the browser and may be looked up using 'name'.
- *
+ * @jsptagref.attributedescription The name which will be rewritten. This value will be output to the page rendered in the browser and may be looked up using 'name'.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_name</i>
- *
* @netui:attribute required="true" rtexprvalue="true"
* description="The name which will be rewritten. This value will be output to the page rendered in the browser and may be looked up using 'name'."
*/
@@ -88,13 +78,9 @@
* Sets the resultId which, if non-null, will store the real name
* in the page context under the resultId name;
* @param resultId - the parameter name.
- * @jsptagref.attributedescription
- * A name that will cause the real name to be stored into the page context under this name.
- *
+ * @jsptagref.attributedescription A name that will cause the real name to be stored into the page context under this name.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_resultId</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="A name that will cause the real name to be stored into the page context under this name."
*/
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java Thu Nov 4 07:35:11 2004
@@ -32,22 +32,17 @@
* rewritting. Some containers such as WebLogic Portal rewrite names so they are unique.
* This tag will cause the name to be made available from <code>getNetuiTagName</code>
* JavaScript which is output from the <netui:html> tag.
- *
- * @jsptagref.tagdescription
- * Allows a tag name, typically either an id or name attribute, to participate in URL
+ * @jsptagref.tagdescription Allows a tag name, typically either an id or name attribute, to participate in URL
* rewritting. Some containers such as WebLogic Portal rewrite names so they are unique.
* This tag will cause the name to be made available from the <code>getNetuiTagName( tagId, tag )</code>
* JavaScript function (which is written to the page by the <netui:html> tag).
- *
- * @example
- * In this sample, the id attribute of a <span> tag is set to 'foo'. The
- * actual value that will be written to the rendered HTML may change depending
+ * @example In this sample, the id attribute of a <span> tag is set to 'foo'. The
+ * actual value that will be written to the rendered HTML may change depending
* on the application container. (Portal containers sometimes rewrite the id attributes
- * to ensure their uniqueness.) But the value 'foo' can be passed to
- * <code>getNetuiTagName( tagId, tag )</code> to find the
+ * to ensure their uniqueness.) But the value 'foo' can be passed to
+ * <code>getNetuiTagName( tagId, tag )</code> to find the
* value of the id attribute actually rendered in the browser.
* <pre> <span id="<netui:rewriteURL URL="foo"/>"></pre>
- *
* @netui:tag name="rewriteURL" description="Allows the URL Rewriter to rewrite the url attribute before it is output into the HTML stream."
* @netui.tldx:tag requiredchild="#nothing"
* renderer="workshop.netui.jspdesigner.tldx.RewriteURLRenderer"
@@ -69,13 +64,9 @@
/**
* Sets the name to be rewritten.
* @param url - the parameter name.
- * @jsptagref.attributedescription
- * The value of the URL that will be rewritten.
- *
+ * @jsptagref.attributedescription The value of the URL that will be rewritten.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_url</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The value of the URL that will be rewritten."
*/
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java Thu Nov 4 07:35:11 2004
@@ -22,6 +22,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -37,10 +38,7 @@
* container it provides) can result in cluttered code, especially where Javascript
* appears in the file. To solve this issue, WebLogic Workshop provides the
* <netui:scriptContainer> tag.
- *
-
- * @jsptagref.tagdescription
- * Acts as a container that will bundle up JavaScript created by other <netui...> tags,
+ * @jsptagref.tagdescription Acts as a container that will bundle up JavaScript created by other <netui...> tags,
* and outputs it within a single <script> tag. This is especially useful for
* Portal web applications, because they often cannot rely on having
* <html> ... </html> tags to provide a default container. In a Portlet,
@@ -50,17 +48,15 @@
* container it provides) can result in cluttered code, especially where JavaScript
* appears in the file. To solve this issue, WebLogic Workshop provides the
* <netui:scriptContainer> tag.
- *
+ *
* <p>The <netui:scriptContainer> ... </netui:scriptContainer> tag set should
* enclose those <netui:...> tags that you want included in the script container.
* The first <netui:scriptContainer> tag should appear after the JSP's <body> tag.
* The closing </netui:scriptContainer> tag should appear before the JSP's </body> tag.
- *
* @example The <netui:scriptContainer> ... </netui:scriptContainer tag set simply
* encloses other NetUI tags that you want to belong to that script container.
* The first <netui:scriptContainer> tag should appear after the JSP's <body> tag.
* The closing </netui:scriptContainer> tag should appear before the JSP's </body> tag.
- *
* @netui:tag name="scriptContainer" description="ScriptContainers defines a container that will gather all of the JavaScript of their children and output it in a single <script> tag. In addition, they providing scoping of tagIds."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ScriptContainerRenderer" whitespace="indent"
*/
@@ -190,6 +186,19 @@
_writeScript = true;
}
+ public void writeScript(PageContext pc)
+ {
+ assert(pc != null) : "The paramter 'sb' must not be null;";
+
+ if (isRunAtClient()) {
+ addInitCode();
+ addAnchorRewriters();
+ }
+ String script = writeScriptBlock();
+ write(script);
+ _writeScript = true;
+ }
+
/**
* This method will output all of the Script that appears inside the <head> tag.
* @param sb The script is written into the provided StringBuilder. This value must not be null.
@@ -222,13 +231,9 @@
/**
* Set the scopeId associated with the code methods
- * @jsptagref.attributedescription
- * The id that is associated with the script methods.
- *
+ * @jsptagref.attributedescription The id that is associated with the script methods.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_scopeId</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The id that is associated with the script methods."
*/
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptHeader.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptHeader.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptHeader.java Thu Nov 4 07:35:11 2004
@@ -25,10 +25,7 @@
/**
* ScriptHeader will write the <script> and JavaScript includes into the HTML <head> tag.
- *
- * @jsptagref.tagdescription
- * ScriptHeader will write the <script> and JavaScript includes into the HTML <head> tag.
- *
+ * @jsptagref.tagdescription ScriptHeader will write the <script> and JavaScript includes into the HTML <head> tag.
* @netui:tag name="scriptHeader" description="ScriptHeader will write the <script> and JavaScript includes into the HTML <head> tag."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ScriptHeaderRenderer" whitespace="indent"
*/
@@ -51,16 +48,11 @@
* .js file. This string should be a common separated list of features. The mapping between the feature
* name and .js file is found in the netui.config file.
* @param features - the common separated list of features included.
- *
- * @jsptagref.attributedescription
- * Set a list of features that we will generate JavaScript script HTML element including the defined
+ * @jsptagref.attributedescription Set a list of features that we will generate JavaScript script HTML element including the defined
* .js file. This string should be a common separated list of features. The mapping between the feature
* name and .js file is found in the netui.config file.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_feature</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="Set a list of features that we will generate JavaScript script HTML element including the defined
* .js file."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java Thu Nov 4 07:35:11 2004
@@ -19,8 +19,8 @@
import org.apache.beehive.netui.pageflow.ProcessPopulate;
import org.apache.beehive.netui.pageflow.RequestParameterHandler;
-import org.apache.beehive.netui.script.common.IDataAccessProvider;
import org.apache.beehive.netui.script.common.DataAccessProviderStack;
+import org.apache.beehive.netui.script.common.IDataAccessProvider;
import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor;
import org.apache.beehive.netui.tags.naming.IndexedNameInterceptor;
import org.apache.beehive.netui.tags.naming.PrefixNameInterceptor;
@@ -42,63 +42,60 @@
*
* If Select uses any Format tags, it must have those tags come before any nested
* SelectOption tags.
+ * @jsptagref.tagdescription Renders an HTML <select> tag containing a set of selectable options.
*
-
- * @jsptagref.tagdescription
- * Renders an HTML <select> tag containing a set of selectable options.
- *
- * <p>The <netui:select> tag can generate a set of
+ * <p>The <netui:select> tag can generate a set of
* selectable options in two ways:
- *
+ *
* <blockquote>
* <ol>
- * <li>they can be dynamically generated by pointing the
- * <netui:select> tag at a String[] object or
+ * <li>they can be dynamically generated by pointing the
+ * <netui:select> tag at a String[] object or
* {@link java.util.HashMap java.util.HashMap}</li>
- * <li>they can be statically generated by providing a set of children
+ * <li>they can be statically generated by providing a set of children
* {@link SelectOption}
* tags</li>
* </ol>
* </blockquote>
- *
+ *
* <p><b>Dynamically Generated Options</b>
- *
+ *
* <p>You can dynamically generate a set of selectable options by
* pointing the <netui:select> tag at a String[].
- *
+ *
* <pre> public String[] _options = {"red", "green", "blue", "orange", "pink", "aqua", "black", "brown", "tan"};</pre>
- *
+ *
* <p>To point the <netui:select> tag
* at the String[] object use the <code>optionsDataSource</code> attribute.
- *
+ *
* <pre> <netui:select optionsDataSource="{pageFlow._options}"</pre>
- *
+ *
* Note that you can make the display value and the submitted value differ by pointing the <netui:select>
- * tag at a HashMap object.
+ * tag at a HashMap object.
* (Any object that implements the {@link java.util.Map java.util.Map} interface will work.)
- *
+ *
* <pre> public HashMap _hashMap = new HashMap();
- *
+ *
* protected void onCreate()
* {
* _hashMap.put("#ff3333", "red");
* _hashMap.put("#3333ff", "blue");
* _hashMap.put("#33ff33", "green");
* }</pre>
- *
+ *
* The following HTML will be generated.
- *
+ *
* <pre> <select size="3">
* <option value="#3333ff">blue</option>
* <option value="#33ff33">green</option>
* <option value="#ff3333">red</option>
* </select></pre>
- *
+ *
* <p><b>Statically Generated Options</b></p>
- *
+ *
* <p>To statically generate selecable options, place a set of <netui:selectOption> tags inside
* the <netui:select> tag.
- *
+ *
* <pre> <netui:select dataSource="{actionForm.selections}" size="5">
* <netui:selectOption value="red" />
* <netui:selectOption value="blue" />
@@ -106,57 +103,53 @@
* <netui:selectOption value="yellow" />
* <netui:selectOption value="orange" />
* </netui:select></pre>
- *
+ *
* <p><b>Submitting Selections</b></p>
- *
+ *
* <p>A <netui:select> is submitted as a String or String[] object, depending on whether the
* <code>multiple</code> attribute is set to true. In the following example, the <code>dataSource</code>
* attribute points at a String[] object.
- *
+ *
* <pre> </netui:select dataSource="{actionForm.selections}"></pre>
- *
+ *
* <p>In this case, the <netui:select> tag submits to a String[] field of a Form Bean.
- *
+ *
* <pre> public static class SubmitForm extends FormData
* {
* private String[] selections;
- *
+ *
* public void setSelections(String[] selections)
*
* {
* this.selections = selections;
* }
- *
+ *
* public String[] getSelections()
* {
* return this.selections;
* }
* }</pre>
- *
- *
- * @example
- * The following sample uses the <code>optionsDataSource</code> attribute to reference a
- * dynamically generated dropdown list.
+ * @example The following sample uses the <code>optionsDataSource</code> attribute to reference a
+ * dynamically generated dropdown list.
*
* <pre>
* <netui:select dataSource="{actionForm.selectedOption}"
* optionsDataSource="{actionForm.itemOptions}" />
* </pre>
*
- * <p>Assume that the <code>optionsDataSource</code> attribute refers to
- * a <code>java.util.Map</code> object.
+ * <p>Assume that the <code>optionsDataSource</code> attribute refers to
+ * a <code>java.util.Map</code> object.
* The Map object will be rendered as a series
- * of <option> tags. HTML that is similar to the following will be
+ * of <option> tags. HTML that is similar to the following will be
* rendered in the browser:</p>
- *
+ *
* <pre> <select>
* <option value="633">Aurora Bridge</option>
* <option value="631">FA-18 fighter jet</option>
* <option value="635">Space Needle</option>
* <option value="642">Thin Mints</option>
- * ...
+ * ...
* </select></pre>
- *
* @netui:tag name="select" description="Defines a multiple-choice menu or drop-down list within a netui:form element."
* @netui:attribute name="onSelect" hide="true"
* description=""
@@ -404,15 +397,11 @@
/**
* Set whether multiple selections are allowed.
* @param multiple - the multiple value ("true" or "false")
- * @jsptagref.attributedescription
- * Boolean. Whether or not multi-selection is enabled.
- * If multiple selection is enabled, a null option will not be displayed, even if
+ * @jsptagref.attributedescription Boolean. Whether or not multi-selection is enabled.
+ * If multiple selection is enabled, a null option will not be displayed, even if
* the <code>nullable</code> is set to true.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_multipleSelectEnabled</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Whether or not multi-selection is enabled.
* If multiple selection is enabled, a null option will not be displayed, even if
@@ -446,15 +435,11 @@
/**
* Set whether a null option is desired.
* @param nullable - the nullable value
- * @jsptagref.attributedescription
- * Boolean.
- * Whether a option with the value null should be added to the bottom of the list.
+ * @jsptagref.attributedescription Boolean.
+ * Whether a option with the value null should be added to the bottom of the list.
* If <select> has the multiple <code>attribute</code> set to true, the null option won't be shown.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_nullable</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Whether a option with the value null should be added to the bottom of the list.
* If <select> has the multiple attribute set to true, the null option won't be shown."
@@ -478,16 +463,12 @@
* Set the text of the nullable option.
* If the <code>nullable<code> option is true, this is
* the text of that option. The default is "";
- * @jsptagref.attributedescription
- * Boolean.
- * If the <code>nullable</code> attribute is set to true, then the <code>nullableOptionText</code>
- * attribute determines the display text of the null option.
+ * @jsptagref.attributedescription Boolean.
+ * If the <code>nullable</code> attribute is set to true, then the <code>nullableOptionText</code>
+ * attribute determines the display text of the null option.
* The default is to use the empty string, "", as the display text.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_nullableOptionText</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="If the nullable attribute is set to true, then the nullableOptionText
* attribute determines the display text of the null option.
@@ -544,13 +525,9 @@
/**
* Sets how many options are displayed.
* @param size - the size (a number)
- * @jsptagref.attributedescription
- * The number of visible options
- *
+ * @jsptagref.attributedescription The number of visible options
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>integer_size</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The number of visible options"
* @netui.tldx:attribute
@@ -757,11 +734,18 @@
String realName = doNaming();
// create the string buffer for the results
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
+
+ if (hasErrors()) {
+ reportErrors();
+ localRelease();
+ return EVAL_PAGE;
+ }
// Only write out the hidden field if the select is not
// disabled. If it is disabled, then nothing will be posted
// back from this.
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (!_state.disabled) {
_hiddenState.clear();
String hiddenParamName = null;
@@ -770,25 +754,25 @@
_hiddenState.value = "true";
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
- hiddenTag.doStartTag(results, _hiddenState);
- hiddenTag.doEndTag(results);
- results.append("\n");
+ hiddenTag.doStartTag(writer, _hiddenState);
+ hiddenTag.doEndTag(writer);
+ write("\n");
}
// Render any formatting errors that may have occurred.
if (fmtErrors != null)
- results.append(fmtErrors);
+ write(fmtErrors);
// Create an appropriate "form" element based on our parameters
_state.name = realName;
scriptId = renderTagId(_state, realName, false, true);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SELECT_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
// Render the content of the body, these would be the options
- if (_saveBody != null) {
- results.append(_saveBody);
+ if (_saveBody != null) {
+ write(_saveBody);
}
// if we are repeating then the body contained the options so we can exit here
@@ -799,12 +783,12 @@
localRelease();
return EVAL_PAGE;
}
- br.doEndTag(results);
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
// Continue processing this page
localRelease();
@@ -824,7 +808,7 @@
optionDisplay = dynamicOptionsMap.get(optionValue).toString();
}
- addOption(req, results, optionValue.toString(), optionDisplay);
+ addOption(req, optionValue.toString(), optionDisplay);
}
}
else if (_dynamicOptions instanceof Iterator) {
@@ -833,31 +817,26 @@
Object o = dynamicOptionsIterator.next();
if (o != null) {
String optionValue = o.toString();
- addOption(req, results, optionValue, optionValue);
+ addOption(req, optionValue, optionValue);
}
}
}
}
// add the value from the DataSource and Default value
- addDatasourceIfNeeded(req, results);
- addDefaultsIfNeeded(req, results);
+ addDatasourceIfNeeded(req);
+ addDefaultsIfNeeded(req);
if (_nullable && !isMultiple()) {
String txt = (_nullableOptionText != null) ? _nullableOptionText : "";
- addOption(req, results, NULL_VALUE, txt);
+ addOption(req, NULL_VALUE, txt);
}
- if (hasErrors()) {
- reportErrors();
- localRelease();
- return EVAL_PAGE;
- }
- br.doEndTag(results);
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
// Continue processing this page
localRelease();
@@ -869,9 +848,9 @@
*/
protected void localRelease()
{
- if(_repeater)
+ if (_repeater)
DataAccessProviderStack.removeDataAccessProvider(pageContext);
-
+
super.localRelease();
_state.clear();
//_optionState.clear();
@@ -906,9 +885,9 @@
while (pos < len) {
// find the start of a span, if we dont' find one then it's over....
- int start = _saveBody.indexOf("<span",pos);
+ int start = _saveBody.indexOf("<span", pos);
if (start == -1)
- break;
+ break;
// if we don't find the end of the <span> then we don't have a legal span so ignore it
int end = _saveBody.indexOf(END_TOKEN);
@@ -917,13 +896,13 @@
// copy the pos to start into the body
int realEnd = end + END_TOKEN.length() + 1;
- body.append(_saveBody.substring(pos,start));
- error.append(_saveBody.substring(start,realEnd));
+ body.append(_saveBody.substring(pos, start));
+ error.append(_saveBody.substring(start, realEnd));
pos = realEnd;
}
// recreate the remainder of the body, everything not left
- body.append(_saveBody.substring(pos,len));
+ body.append(_saveBody.substring(pos, len));
_saveBody = body.toString();
// return the error
@@ -1075,7 +1054,7 @@
}
// add the default values specified in the tag if they are needed.
- private void addDefaultsIfNeeded(ServletRequest req, StringBuilder buffer)
+ private void addDefaultsIfNeeded(ServletRequest req)
throws JspException
{
if (_defaultSelections != null) {
@@ -1083,7 +1062,7 @@
while (iterator.hasNext()) {
Object selection = iterator.next();
if (!_optionList.contains(selection)) {
- addOption(req, buffer, selection.toString(), selection.toString());
+ addOption(req, selection.toString(), selection.toString());
}
}
}
@@ -1095,7 +1074,7 @@
}
// add dthe datasource values if needed.
- private void addDatasourceIfNeeded(ServletRequest req, StringBuilder buffer)
+ private void addDatasourceIfNeeded(ServletRequest req)
throws JspException
{
if (_match == null)
@@ -1104,20 +1083,18 @@
for (int i = 0; i < _match.length; i++) {
if (!_optionList.contains(_match[i])) {
if (!_match[i].equals(NULL_VALUE))
- addOption(req, buffer, _match[i], _match[i]);
+ addOption(req, _match[i], _match[i]);
}
}
}
- private void addOption(ServletRequest req, StringBuilder buffer, String optionValue,
- String optionDisplay)
+ private void addOption(ServletRequest req, String optionValue, String optionDisplay)
throws JspException
{
- assert(buffer != null);
assert(optionValue != null);
assert(optionDisplay != null);
- buffer.append("\n");
+ write("\n");
_optionState.clear();
_optionState.value = optionValue;
_optionState.style = _state.style;
@@ -1127,21 +1104,22 @@
_optionState.selected = true;
}
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
if (_optRb == null)
_optRb = TagRenderingBase.Factory.getRendering(TagRenderingBase.OPTION_TAG, req);
- _optRb.doStartTag(buffer, _optionState);
+ _optRb.doStartTag(writer, _optionState);
if (optionDisplay != null) {
- buffer.append(formatText(optionDisplay));
+ write(formatText(optionDisplay));
}
else {
- buffer.append("<");
- buffer.append(optionValue);
- buffer.append(">");
+ write("<");
+ write(optionValue);
+ write(">");
}
- _optRb.doEndTag(buffer);
+ _optRb.doEndTag(writer);
addOptionToList(optionValue);
}
@@ -1159,7 +1137,8 @@
* Indicate that a formatter has reported an error so the formatter should output it's
* body text.
*/
- public void formatterHasError() {
+ public void formatterHasError()
+ {
_formatterError = true;
}
@@ -1178,7 +1157,7 @@
public String formatText(Object text)
throws JspException
{
- int cnt = _formatters.size();
+ int cnt = _formatters.size();
for (int i = 0; i < cnt; i++) {
FormatTag.Formatter currentFormatter = (FormatTag.Formatter) _formatters.get(i);
try {
@@ -1204,16 +1183,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -1229,14 +1204,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java Thu Nov 4 07:35:11 2004
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.OptionTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.ServletRequest;
@@ -267,7 +268,7 @@
// Generate an HTML <option> element
- StringBuilder results = new StringBuilder(128);
+ //StringBuilder results = new StringBuilder(128);
_state.value = _value;
// we assume that tagId will over have override id if both
@@ -287,24 +288,25 @@
if (parentSelect.isMatched(_value))
_state.selected = true;
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.OPTION_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
if (_text == null)
- results.append(parentSelect.formatText(_value));
+ write(parentSelect.formatText(_value));
else {
//@TODO: How should we report errors
- results.append(parentSelect.formatText(_text));
+ write(parentSelect.formatText(_text));
}
- br.doEndTag(results);
+ br.doEndTag(writer);
parentSelect.addOptionToList(_value);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
// Continue evaluating this page
localRelease();
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Span.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Span.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Span.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.SpanTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
@@ -32,57 +33,53 @@
*
* <p>If the resulting value to be output is the <nobr>" "</nobr> String, it will output as
* the value <nobr><code>"&nbsp;"</code></nobr>.</p>
- * @jsptagref.tagdescription
- * <p>Generates styled text based on a String literal or data binding expression.
- *
- * <p>The <netui:label> tag is similar to the {@link Content} tag,
- * except with respect to the way that it treats
- * characters sensitive to HTML browsers.
+ * @jsptagref.tagdescription <p>Generates styled text based on a String literal or data binding expression.
+ *
+ * <p>The <netui:label> tag is similar to the {@link Content} tag,
+ * except with respect to the way that it treats
+ * characters sensitive to HTML browsers.
* The <netui:label> tag filters the input string for browser-sensitive characters
- * and replaces these characters
- * with the corresponding entity strings. For example, if you pass the
+ * and replaces these characters
+ * with the corresponding entity strings. For example, if you pass the
* string '&amp;' to a <netui:label> tag, the string '&amp;amp;' will be written to
* the HTML source file, and the following will be displayed
* in the browser: '&amp;'.
- *
+ *
* <p>The following table shows how the <netui:label> and <netui:content> tags treat HTML-sensitive characters.
* <blockquote>
- * <table border="1">
- * <tr>
- * <td width="30%"><b>tag</b></td>
- * <td width="30%"><b>generated HTML source</b></td>
- * <td width="30%"><b>displayed in browser</b></td>
- * </tr>
- * <tr>
- * <td><netui:content value="&amp;"/></td>
- * <td>&amp;</td>
- * <td>&</td>
- * </tr>
- * <tr>
- * <td><netui:label value="&amp;"/></td>
- * <td>&amp;amp;</td>
- * <td>&amp;</td>
- * </tr>
- * </table>
+ * <table border="1">
+ * <tr>
+ * <td width="30%"><b>tag</b></td>
+ * <td width="30%"><b>generated HTML source</b></td>
+ * <td width="30%"><b>displayed in browser</b></td>
+ * </tr>
+ * <tr>
+ * <td><netui:content value="&amp;"/></td>
+ * <td>&amp;</td>
+ * <td>&</td>
+ * </tr>
+ * <tr>
+ * <td><netui:label value="&amp;"/></td>
+ * <td>&amp;amp;</td>
+ * <td>&amp;</td>
+ * </tr>
+ * </table>
* </blockquote>
- *
+ *
* <p><b>Note:</b> escaping is <i>not</i> applied to browser-sensitive characters in
- * the <code>defaultValue</code> attribute.
- *
- * @example
- * In this first sample, a <netui:label> tag displays the Form Bean's firstName property.
- * The <netui:label> tag will resolve this data binding expression, and display its value.
- *
+ * the <code>defaultValue</code> attribute.
+ * @example In this first sample, a <netui:label> tag displays the Form Bean's firstName property.
+ * The <netui:label> tag will resolve this data binding expression, and display its value.
+ *
* <pre> <netui:label value="{actionForm.firstName}" /></pre>
- *
+ *
* <p>In this next sample, the <code>value</code> attribute will resolve to null.
* This causes the <code>defaultValue</code> to be displayed. The user will see ' '.</p>
* <pre> <netui:label value="{pageFlow.somethingNull}" defaultValue="&nbsp;"/></pre>
- *
+ *
* <p>In this next sample, the HTML will contain the text "&amp;nbsp;" and the user will
* see '&nbsp;'</p>
* <pre> <netui:label value="{pageFlow.somethingNull}" defaultValue="&amp;nbsp;"/></pre>
- *
* @netui:tag name="span" description="Places formatted or dynamically generated text on the page inside an HTML span."
* @netui.tldx:tag requiredchild="formatDate formatNumber formatString attribute"
* renderer="workshop.netui.jspdesigner.tldx.LabelRenderer"
@@ -150,7 +147,7 @@
}
}
- StringBuilder results = new StringBuilder(64);
+ //StringBuilder results = new StringBuilder(64);
// we assume that tagId will over have override id if both
// are defined.
@@ -164,19 +161,9 @@
_state.id = _id;
}
- TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
- br.doStartTag(results, _state);
-
// push the evaluated expression when we are not client side bound...
String labelValue = formatText(labelObject);
- if (!bypassEscape)
- results.append(filter(labelValue, _escapeWhiteSpace));
- else
- results.append(labelValue);
-
- br.doEndTag(results);
-
// if there were errors in the formatters, report them.
if (_formatterErrors) {
if (bodyContent != null) {
@@ -186,16 +173,24 @@
}
}
- if (hasErrors()) {
- reportErrors();
- localRelease();
- return EVAL_PAGE;
- }
+ if (hasErrors())
+ return reportAndExit(EVAL_PAGE);
+
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
+ TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
+ br.doStartTag(writer, _state);
+
+ if (!bypassEscape)
+ write(filter(labelValue, _escapeWhiteSpace));
+ else
+ write(labelValue);
+
+ br.doEndTag(writer);
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextArea.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextArea.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextArea.java Thu Nov 4 07:35:11 2004
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
import org.apache.beehive.netui.tags.rendering.TextAreaTag;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspException;
@@ -28,22 +29,16 @@
/**
* Renders a databound TextArea with the given attributes.
+ * @jsptagref.tagdescription Renders an HTML <input> tag of type "text".
*
-
- * @jsptagref.tagdescription
- * Renders an HTML <input> tag of type "text".
- *
- * <pre> <input type="text"/></pre>
- *
- * @example
- * In this sample a text area reads from and writes to the Form Bean's
- * description property. If the submitted value is NULL the default value is specified
- * by the Page Flow's
+ * <pre> <input type="text"/></pre>
+ * @example In this sample a text area reads from and writes to the Form Bean's
+ * description property. If the submitted value is NULL the default value is specified
+ * by the Page Flow's
* defaultDescription property.
* <pre> <netui:textArea dataSource="{actionForm.description}"
* defaultValue="{pageFlow.defaultDescription}"
* cols="25" rows="3" /></pre>
- *
* @netui:tag name="textArea" description="Renders a databound TextArea with the given attributes."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.TextAreaRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -108,13 +103,9 @@
/**
* Sets the number of columns in the TextArea.
* @param cols - the number of columns
- * @jsptagref.attributedescription
- * Integer. The number of columns in the <netui:textArea>.
- *
+ * @jsptagref.attributedescription Integer. The number of columns in the <netui:textArea>.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_columns</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The number of columns in the <netui:textArea>."
* @netui.tldx:attribute
@@ -127,13 +118,9 @@
/**
* Set if this TextArea is read-only.
* @param readonly - the read-only state
- * @jsptagref.attributedescription
- * Boolean. Determines whether text can be entered in the <netui:textArea> or not.
- *
+ * @jsptagref.attributedescription Boolean. Determines whether text can be entered in the <netui:textArea> or not.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_disabled</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines whether text can be entered in the <netui:textArea> or not."
*/
@@ -145,13 +132,9 @@
/**
* Sets the number of rows in the TextArea.
* @param rows - the number of rows
- * @jsptagref.attributedescription
- * The number of rows in the <netui:textArea>
- *
+ * @jsptagref.attributedescription The number of rows in the <netui:textArea>
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_rows</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The number of rows in the <netui:textArea>"
* @netui.tldx:attribute
@@ -199,7 +182,7 @@
}
// Buffer to write the results
- StringBuilder results = new StringBuilder(64);
+ //StringBuilder results = new StringBuilder(64);
// if there were format errors then report them
if (_formatErrors) {
@@ -211,8 +194,9 @@
}
// create the input tag.
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.TEXT_AREA_TAG, req);
- br.doStartTag(results, _state);
+ br.doStartTag(writer, _state);
// create the text value which will be found inside the textarea.
if ((textObject == null) || (textObject.toString().length() == 0)) {
@@ -224,9 +208,10 @@
text = HtmlUtils.filter(text);
if (text == null)
text = "";
+ write(text);
- results.append(text);
- br.doEndTag(results);
+ //results.append(text);
+ br.doEndTag(writer);
// if there are errors report them...
if (hasErrors()) {
@@ -237,9 +222,10 @@
// report any script
if (scriptId != null)
- results.append(scriptId);
+ write(scriptId);
+ //results.append(scriptId);
- write(results.toString());
+ //write(results.toString());
localRelease();
return EVAL_PAGE;
@@ -268,12 +254,13 @@
_formatters.add(formatter);
}
-
+
/**
* Indicate that a formatter has reported an error so the formatter should output it's
* body text.
*/
- public void formatterHasError() {
+ public void formatterHasError()
+ {
_formatErrors = true;
}
@@ -312,16 +299,12 @@
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
- * are often used by browsers: <code>A, C, E, F, G,
+ * are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -336,14 +319,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
- * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * tag in the sequence of page elements that the user may advance through by pressing the TAB key.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java Thu Nov 4 07:35:11 2004
@@ -22,6 +22,7 @@
import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
import org.apache.beehive.netui.tags.rendering.InputTextTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
+import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.ServletRequest;
@@ -30,18 +31,12 @@
/**
* Renders a databound TextBox with the given attributes.
- *
-
- * @jsptagref.tagdescription
- * Renders an HTML <input type="text"> tag.
- *
- * @example
- * In this sample, a <netui:textBox> reads from and writes to the Form Bean's firstname property.
+ * @jsptagref.tagdescription Renders an HTML <input type="text"> tag.
+ * @example In this sample, a <netui:textBox> reads from and writes to the Form Bean's firstname property.
* If the submitted text is NULL, the default value is specified by the Page Flow's firstName property.
* <pre> <netui:textBox dataSource="{actionForm.firstName}"
* defaultValue="{pageFlow.defaultFirstName}"
* size="20" /></pre>
- *
* @netui:tag name="textBox" description="Renders a databound TextBox with the given attributes."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.TextboxRenderer" bodycontentpref="empty" whitespace="indent"
*/
@@ -116,13 +111,9 @@
/**
* Set the maximum length (in characters) of the TextBox.
* @param maxlength - the max length
- * @jsptagref.attributedescription
- * Integer. The maximum number of character that can be entered in the rendered <input> element.
- *
+ * @jsptagref.attributedescription Integer. The maximum number of character that can be entered in the rendered <input> element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_maxLength</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The maximum number of character that can be entered in the rendered <input> element."
* @netui.tldx:attribute
@@ -135,13 +126,9 @@
/**
* Set the password state (true means this is a password field).
* @param password - the password state
- * @jsptagref.attributedescription
- * Boolean. Determines whether the password characters that the user enters into the <input> element will be disguised in the browser.
- *
+ * @jsptagref.attributedescription Boolean. Determines whether the password characters that the user enters into the <input> element will be disguised in the browser.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_password</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines whether the password characters that the user enters into the <input> element will be disguised in the browser."
*/
@@ -153,13 +140,9 @@
/**
* Set if this TextBox is read-only.
* @param readonly - the read-only state
- * @jsptagref.attributedescription
- * Boolean. Determines if the rendered <input> element is read-only.
- *
+ * @jsptagref.attributedescription Boolean. Determines if the rendered <input> element is read-only.
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_readOnly</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
* description="Determines if the rendered <input> element is read-only"
*/
@@ -171,13 +154,9 @@
/**
* Set the size (in characters) of the TextBox.
* @param size - the size
- * @jsptagref.attributedescription
- * Integer. The number of characters visible in the <input> element.
- *
+ * @jsptagref.attributedescription Integer. The number of characters visible in the <input> element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>integer_size</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The number of characters visible in the <input> element."
* @netui.tldx:attribute
@@ -186,22 +165,19 @@
{
_state.size = size;
}
+
/**
* Sets the accessKey attribute value. This should key value of the
* keyboard navigation key. It is recommended not to use the following
* values because there are often used by browsers <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>.
* @param accessKey - the accessKey value.
- * @jsptagref.attributedescription
- * The keyboard navigation key for the element.
+ * @jsptagref.attributedescription The keyboard navigation key for the element.
* The following values are not recommended because they
* are often used by browsers: <code>A, C, E, F, G,
* H, V, left arrow, and right arrow</code>
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="char"
* description="The keyboard navigation key for the element.
* The following values are not recommended because they
@@ -216,13 +192,9 @@
/**
* Sets the alt attribute value.
* @param alt - the alt value.
- * @jsptagref.attributedescription
- * The alt attribute of the element.
- *
+ * @jsptagref.attributedescription The alt attribute of the element.
* @jsptagref.databindable Read Only
- *
* @jsptagref.attributesyntaxvalue <i>string_alt</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
* description="The alt attribute of the element."
*/
@@ -234,14 +206,10 @@
/**
* Sets the tabIndex of the rendered html tag.
* @param tabindex - the tab index.
- * @jsptagref.attributedescription
- * The tabIndex of the rendered HTML tag. This attribute determines the position of the
+ * @jsptagref.attributedescription The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="int"
* description="The tabIndex of the rendered HTML tag. This attribute determines the position of the
* tag in the sequence of page elements that the user may advance through by pressing the TAB key."
@@ -280,7 +248,6 @@
_state.type = INPUT_TEXT;
}
-
// Create the state for the input tag
_state.name = doNaming();
scriptId = renderTagId(_state, _state.name, false, true);
@@ -300,8 +267,6 @@
}
_state.value = text;
- StringBuilder results = new StringBuilder(256);
-
// if there were format errors then report them
if (_formatErrors) {
if (bodyContent != null) {
@@ -311,22 +276,20 @@
}
}
+ if (hasErrors())
+ return reportAndExit(EVAL_PAGE);
+
// create the input tag.
+ WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_TEXT_TAG, req);
assert(br != null);
- br.doStartTag(results, _state);
- br.doEndTag(results);
+ br.doStartTag(writer, _state);
+ br.doEndTag(writer);
// write any script that needs to be written
if (scriptId != null)
- results.append(scriptId);
-
- // report any errors that may be found
- if (hasErrors())
- reportErrors();
- else
- write(results.toString());
+ write(scriptId);
localRelease();
return EVAL_PAGE;
@@ -362,7 +325,8 @@
* Indicate that a formatter has reported an error so the formatter should output it's
* body text.
*/
- public void formatterHasError() {
+ public void formatterHasError()
+ {
_formatErrors = true;
}
Added: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java Thu Nov 4 07:35:11 2004
@@ -0,0 +1,9 @@
+package org.apache.beehive.netui.tags.rendering;
+
+/**
+ * This is an abstract base class that represents the appender. It is used by the Renderers to render output.
+ */
+abstract public class AbstractRenderAppender
+{
+ abstract public void append(String s);
+}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AnchorTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AnchorTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AnchorTag.java Thu Nov 4 07:35:11 2004
@@ -63,7 +63,7 @@
*/
private static class Rendering extends AnchorTag
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -86,7 +86,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, ANCHOR);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BaseTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BaseTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BaseTag.java Thu Nov 4 07:35:11 2004
@@ -49,7 +49,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -66,17 +66,17 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
// do nothing...
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
private static class HtmlRendering extends BaseTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
@@ -84,7 +84,7 @@
private static class XhtmlRendering extends BaseTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BodyTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BodyTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/BodyTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -43,7 +44,7 @@
private static class Rendering extends BodyTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -61,7 +62,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, BODY);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/CaptionTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/CaptionTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/CaptionTag.java Thu Nov 4 07:35:11 2004
@@ -43,7 +43,7 @@
private static class Rendering extends CaptionTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -62,7 +62,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, CAPTION);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ConstantRendering.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ConstantRendering.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ConstantRendering.java Thu Nov 4 07:35:11 2004
@@ -22,36 +22,36 @@
*/
abstract public class ConstantRendering
{
- abstract public void BR(StringBuilder sb);
+ abstract public void BR(AbstractRenderAppender sb);
- public void TR_TD(StringBuilder sb)
+ public void TR_TD(AbstractRenderAppender sb)
{
sb.append("<tr><td>");
}
- public void end_TD_TR(StringBuilder sb)
+ public void end_TD_TR(AbstractRenderAppender sb)
{
sb.append("</td></tr>");
}
- public void TABLE(StringBuilder sb)
+ public void TABLE(AbstractRenderAppender sb)
{
sb.append("<table>");
}
- public void end_TABLE(StringBuilder sb)
+ public void end_TABLE(AbstractRenderAppender sb)
{
sb.append("</table>");
}
- public void NBSP(StringBuilder sb)
+ public void NBSP(AbstractRenderAppender sb)
{
sb.append(" ");
}
private static class HtmlConstants extends ConstantRendering
{
- public void BR(StringBuilder sb)
+ public void BR(AbstractRenderAppender sb)
{
sb.append("<br>");
}
@@ -59,7 +59,7 @@
private static class XhtmlConstants extends ConstantRendering
{
- public void BR(StringBuilder sb)
+ public void BR(AbstractRenderAppender sb)
{
sb.append("<br />");
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/DivTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/DivTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/DivTag.java Thu Nov 4 07:35:11 2004
@@ -42,7 +42,7 @@
private static class Rendering extends DivTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -60,7 +60,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, DIV);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java Thu Nov 4 07:35:11 2004
@@ -49,7 +49,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
State state = (State) renderState;
@@ -66,16 +66,16 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, FORM);
}
- abstract void renderNameAndId(StringBuilder sb, State renderState);
+ abstract void renderNameAndId(AbstractRenderAppender sb, State renderState);
private static class HtmlRendering extends FormTag
{
- public void renderNameAndId(StringBuilder sb, State state)
+ public void renderNameAndId(AbstractRenderAppender sb, State state)
{
renderAttribute(sb, NAME, state.name);
renderAttribute(sb, ID, state.id);
@@ -84,7 +84,7 @@
private static class XhtmlRendering extends FormTag
{
- public void renderNameAndId(StringBuilder sb, State state)
+ public void renderNameAndId(AbstractRenderAppender sb, State state)
{
renderAttribute(sb, ID, state.name);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -45,7 +46,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
State state = (State) renderState;
@@ -59,36 +60,35 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, HTML);
}
- abstract protected void renderAdditionalAttributes(StringBuilder sb, State renderState);
+ abstract protected void renderAdditionalAttributes(AbstractRenderAppender sb, State renderState);
- abstract protected void renderDocType(StringBuilder sb);
+ abstract protected void renderDocType(AbstractRenderAppender sb);
private static class HtmlRendering extends HtmlTag
{
- protected void renderDocType(StringBuilder sb)
+ protected void renderDocType(AbstractRenderAppender sb)
{
sb.append("<!DOCTYPE HTML PUBLIC \"//W3C//DTD HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">");
}
- protected void renderAdditionalAttributes(StringBuilder sb, State renderState)
+ protected void renderAdditionalAttributes(AbstractRenderAppender sb, State renderState)
{
}
-
}
private static class XhtmlRendering extends HtmlTag
{
- protected void renderDocType(StringBuilder sb)
+ protected void renderDocType(AbstractRenderAppender sb)
{
sb.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
}
- protected void renderAdditionalAttributes(StringBuilder sb, State renderState)
+ protected void renderAdditionalAttributes(AbstractRenderAppender sb, State renderState)
{
renderAttribute(sb, "xml:lang", renderState.lang);
renderAttribute(sb, "xmlns", "http://www.w3.org/1999/xhtml");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ImageTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ImageTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ImageTag.java Thu Nov 4 07:35:11 2004
@@ -50,7 +50,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -72,15 +72,15 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
private static class HtmlRendering extends ImageTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
@@ -88,7 +88,7 @@
private static class XhtmlRendering extends ImageTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputBooleanTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputBooleanTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputBooleanTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -53,7 +54,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -78,54 +79,52 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
-
- abstract protected void renderChecked(StringBuilder sb, boolean checked);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
+ abstract protected void renderChecked(AbstractRenderAppender sb, boolean checked);
private static class HtmlRendering extends InputBooleanTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" " + DISABLED);
}
- protected void renderChecked(StringBuilder sb, boolean checked)
+ protected void renderChecked(AbstractRenderAppender sb, boolean checked)
{
if (checked)
sb.append(" " + CHECKED);
}
-
}
private static class XhtmlRendering extends InputBooleanTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, DISABLED, DISABLED);
}
- protected void renderChecked(StringBuilder sb, boolean checked)
+ protected void renderChecked(AbstractRenderAppender sb, boolean checked)
{
if (checked)
renderAttribute(sb, CHECKED, CHECKED);
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputFileTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputFileTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputFileTag.java Thu Nov 4 07:35:11 2004
@@ -47,7 +47,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -69,23 +69,23 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
- abstract protected void renderReadOnly(StringBuilder sb, boolean readonly);
+ abstract protected void renderReadOnly(AbstractRenderAppender sb, boolean readonly);
private static class HtmlRendering extends InputFileTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
- protected void renderReadOnly(StringBuilder sb, boolean readonly)
+ protected void renderReadOnly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
sb.append(" readonly");
@@ -95,12 +95,12 @@
private static class XhtmlRendering extends InputFileTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
- protected void renderReadOnly(StringBuilder sb, boolean readonly)
+ protected void renderReadOnly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
renderAttribute(sb, "readonly", "readonly");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputHiddenTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputHiddenTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputHiddenTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -47,7 +48,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -68,16 +69,15 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
-
+ abstract protected void writeEnd(AbstractRenderAppender sb);
private static class HtmlRendering extends InputHiddenTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
@@ -85,7 +85,7 @@
private static class XhtmlRendering extends InputHiddenTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputImageTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputImageTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputImageTag.java Thu Nov 4 07:35:11 2004
@@ -48,7 +48,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -74,23 +74,23 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
private static class HtmlRendering extends InputImageTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
@@ -101,12 +101,12 @@
private static class XhtmlRendering extends InputImageTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputSubmitTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputSubmitTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputSubmitTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -51,7 +52,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -77,23 +78,23 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
private static class HtmlRendering extends InputSubmitTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
@@ -104,12 +105,12 @@
private static class XhtmlRendering extends InputSubmitTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputTextTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputTextTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/InputTextTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -58,7 +59,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -90,31 +91,30 @@
writeEnd(sb);
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
}
- abstract protected void writeEnd(StringBuilder sb);
+ abstract protected void writeEnd(AbstractRenderAppender sb);
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
-
- abstract protected void renderReadonly(StringBuilder sb, boolean readonly);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
+ abstract protected void renderReadonly(AbstractRenderAppender sb, boolean readonly);
private static class HtmlRendering extends InputTextTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(">");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
}
- protected void renderReadonly(StringBuilder sb, boolean readonly)
+ protected void renderReadonly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
sb.append(" readonly");
@@ -123,21 +123,22 @@
private static class XhtmlRendering extends InputTextTag
{
- protected void writeEnd(StringBuilder sb)
+ protected void writeEnd(AbstractRenderAppender sb)
{
sb.append(" />");
}
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
}
- protected void renderReadonly(StringBuilder sb, boolean readonly)
+ protected void renderReadonly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
renderAttribute(sb, "readonly", "readonly");
}
+
}
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/LabelTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/LabelTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/LabelTag.java Thu Nov 4 07:35:11 2004
@@ -47,7 +47,7 @@
private static class Rendering extends LabelTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -67,7 +67,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, LABEL);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/OptionTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/OptionTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/OptionTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -49,7 +50,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -71,25 +72,24 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, OPTION);
}
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
-
- abstract protected void renderSelected(StringBuilder sb, boolean selected);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
+ abstract protected void renderSelected(AbstractRenderAppender sb, boolean selected);
private static class HtmlRendering extends OptionTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
}
- protected void renderSelected(StringBuilder sb, boolean selected)
+ protected void renderSelected(AbstractRenderAppender sb, boolean selected)
{
if (selected)
sb.append(" selected");
@@ -98,13 +98,13 @@
private static class XhtmlRendering extends OptionTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
}
- protected void renderSelected(StringBuilder sb, boolean selected)
+ protected void renderSelected(AbstractRenderAppender sb, boolean selected)
{
if (selected)
renderAttribute(sb, "selected", "selected");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SelectTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SelectTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SelectTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -50,7 +51,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -72,27 +73,25 @@
renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
sb.append(">");
}
-
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, SELECT);
}
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
-
- abstract protected void renderMultiple(StringBuilder sb, boolean readonly);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
+ abstract protected void renderMultiple(AbstractRenderAppender sb, boolean readonly);
private static class HtmlRendering extends SelectTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
}
- protected void renderMultiple(StringBuilder sb, boolean multiple)
+ protected void renderMultiple(AbstractRenderAppender sb, boolean multiple)
{
if (multiple)
sb.append(" multiple");
@@ -102,14 +101,14 @@
private static class XhtmlRendering extends SelectTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
}
- protected void renderMultiple(StringBuilder sb, boolean multiple)
+ protected void renderMultiple(AbstractRenderAppender sb, boolean multiple)
{
if (multiple)
renderAttribute(sb, "multiple", "multiple");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SpanTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SpanTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/SpanTag.java Thu Nov 4 07:35:11 2004
@@ -43,7 +43,7 @@
private static class Rendering extends SpanTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -61,7 +61,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, SPAN);
}
Added: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java Thu Nov 4 07:35:11 2004
@@ -0,0 +1,37 @@
+package org.apache.beehive.netui.tags.rendering;
+
+import org.apache.beehive.netui.util.logging.Logger;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: dolander
+ * Date: Nov 3, 2004
+ * Time: 7:45:09 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class StringBuilderRenderAppender
+ extends AbstractRenderAppender
+{
+ private static final Logger logger = Logger.getInstance(WriteRenderAppender.class);
+
+ private StringBuilder _sb;
+
+ public StringBuilderRenderAppender()
+ {
+ }
+
+ public StringBuilderRenderAppender(StringBuilder sb)
+ {
+ _sb = sb;
+ }
+
+ public void setPageContext(StringBuilder sb)
+ {
+ _sb = sb;
+ }
+
+ public void append(String s)
+ {
+ _sb.append(s);
+ }
+}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TableTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TableTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TableTag.java Thu Nov 4 07:35:11 2004
@@ -43,7 +43,7 @@
private static class Rendering extends TableTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -62,7 +62,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, TABLE);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagHtmlBase.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagHtmlBase.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagHtmlBase.java Thu Nov 4 07:35:11 2004
@@ -17,6 +17,7 @@
*/
package org.apache.beehive.netui.tags.rendering;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
abstract public class TagHtmlBase extends TagRenderingBase
@@ -26,7 +27,7 @@
* are rendered with in a name="value" style supported by XML.
* @param type an integer key indentifying the map
*/
- protected void renderAttributes(int type, StringBuilder sb, AbstractAttributeState state, boolean doubleQuote)
+ protected void renderAttributes(int type, AbstractRenderAppender sb, AbstractAttributeState state, boolean doubleQuote)
{
HashMap map = null;
switch (type) {
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java Thu Nov 4 07:35:11 2004
@@ -20,8 +20,11 @@
import org.apache.beehive.netui.tags.html.Html;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.struts.util.ResponseUtils;
import javax.servlet.ServletRequest;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.JspException;
import java.util.HashMap;
import java.util.Iterator;
@@ -88,19 +91,19 @@
* @param sb A StringBuilder where the element start tag is appended.
* @param renderState The state assocated with the element.
*/
- abstract public void doStartTag(StringBuilder sb, AbstractTagState renderState);
+ abstract public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState);
/**
* Render the end tag for an element. The end tag will be rendered if the tag requires an end tag.
* @param sb A StringBuilder where the element end tag may be appended.
*/
- abstract public void doEndTag(StringBuilder sb);
+ abstract public void doEndTag(AbstractRenderAppender sb);
/**
* @param buf
* @param name
*/
- protected final void renderTag(StringBuilder buf, String name)
+ protected final void renderTag(AbstractRenderAppender buf, String name)
{
assert (buf != null) : "Parameter 'buf' must not be null.";
assert (name != null) : "Parameter 'name' must not be null";
@@ -113,7 +116,7 @@
* @param buf
* @param name
*/
- protected final void renderEndTag(StringBuilder buf, String name)
+ protected final void renderEndTag(AbstractRenderAppender buf, String name)
{
buf.append("</");
buf.append(name);
@@ -129,7 +132,7 @@
* @param name The name of the attribute
* @param value The value of teh attribute. If this is <code>null</code> the attribute will not be written.
*/
- protected final void renderAttribute(StringBuilder buf, String name, String value)
+ protected final void renderAttribute(AbstractRenderAppender buf, String name, String value)
{
assert (buf != null) : "Parameter 'buf' must not be null.";
assert (name != null) : "Parameter 'name' must not be null";
@@ -144,13 +147,12 @@
buf.append(value);
buf.append("\"");
}
-
/**
* @param buf
* @param name
* @param value
*/
- protected final void renderAttributeSingleQuotes(StringBuilder buf, String name, String value)
+ protected final void renderAttributeSingleQuotes(AbstractRenderAppender buf, String name, String value)
{
assert (buf != null) : "Parameter 'buf' must not be null.";
assert (name != null) : "Parameter 'name' must not be null";
@@ -171,7 +173,7 @@
* are rendered with in a name="value" style supported by XML.
* @param type an integer key indentifying the map
*/
- protected void renderAttributes(int type, StringBuilder sb, AbstractAttributeState state, boolean doubleQuote)
+ protected void renderAttributes(int type, AbstractRenderAppender sb, AbstractAttributeState state, boolean doubleQuote)
{
HashMap map = null;
switch (type) {
@@ -187,15 +189,14 @@
renderGeneral(map, sb, doubleQuote);
}
- final protected void renderAttributes(int type, StringBuilder sb, AbstractAttributeState state) {
+ final protected void renderAttributes(int type, AbstractRenderAppender sb, AbstractAttributeState state) {
renderAttributes(type,sb,state,true);
}
-
/**
* This method will render all of the general attributes.
*/
- protected void renderGeneral(HashMap map, StringBuilder sb, boolean doubleQuote)
+ protected void renderGeneral(HashMap map, AbstractRenderAppender sb, boolean doubleQuote)
{
if (map == null)
return;
@@ -214,6 +215,15 @@
}
}
+ protected final void write(PageContext pc, String string)
+ {
+ try {
+ ResponseUtils.write(pc, string);
+ }
+ catch (JspException e) {
+ logger.error(Bundle.getString("Tags_WriteException"), e);
+ }
+ }
/**
* This is the factory for obtaining a Tag Rendering object. The factory supports to types
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TdTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TdTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TdTag.java Thu Nov 4 07:35:11 2004
@@ -43,7 +43,7 @@
private static class Rendering extends TdTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -62,7 +62,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, TD);
}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TextAreaTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TextAreaTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TextAreaTag.java Thu Nov 4 07:35:11 2004
@@ -19,6 +19,7 @@
import org.apache.beehive.netui.tags.html.HtmlConstants;
+import javax.servlet.jsp.PageContext;
import java.util.HashMap;
/**
@@ -52,7 +53,7 @@
}
}
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -79,25 +80,24 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, TEXTAREA);
}
- abstract protected void renderDisabled(StringBuilder sb, boolean disabled);
-
- abstract protected void renderReadonly(StringBuilder sb, boolean readonly);
+ abstract protected void renderDisabled(AbstractRenderAppender sb, boolean disabled);
+ abstract protected void renderReadonly(AbstractRenderAppender sb, boolean readonly);
private static class HtmlRendering extends TextAreaTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
sb.append(" disabled");
}
- protected void renderReadonly(StringBuilder sb, boolean readonly)
+ protected void renderReadonly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
sb.append(" readonly");
@@ -106,13 +106,13 @@
private static class XhtmlRendering extends TextAreaTag
{
- protected void renderDisabled(StringBuilder sb, boolean disabled)
+ protected void renderDisabled(AbstractRenderAppender sb, boolean disabled)
{
if (disabled)
renderAttribute(sb, "disabled", "disabled");
}
- protected void renderReadonly(StringBuilder sb, boolean readonly)
+ protected void renderReadonly(AbstractRenderAppender sb, boolean readonly)
{
if (readonly)
renderAttribute(sb, "readonly", "readonly");
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TrTag.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TrTag.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TrTag.java Thu Nov 4 07:35:11 2004
@@ -43,7 +43,7 @@
private static class Rendering extends TrTag implements HtmlConstants
{
- public void doStartTag(StringBuilder sb, AbstractTagState renderState)
+ public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState)
{
assert(sb != null) : "Parameter 'sb' must not be null";
assert(renderState != null) : "Parameter 'renderState' must not be null";
@@ -62,7 +62,7 @@
sb.append(">");
}
- public void doEndTag(StringBuilder sb)
+ public void doEndTag(AbstractRenderAppender sb)
{
renderEndTag(sb, TR);
}
Added: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/WriteRenderAppender.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/WriteRenderAppender.java Thu Nov 4 07:35:11 2004
@@ -0,0 +1,37 @@
+package org.apache.beehive.netui.tags.rendering;
+
+import org.apache.struts.util.ResponseUtils;
+import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+
+public class WriteRenderAppender extends AbstractRenderAppender
+{
+ private static final Logger logger = Logger.getInstance(WriteRenderAppender.class);
+
+ private PageContext _pc;
+
+ public WriteRenderAppender()
+ {
+ }
+
+ public WriteRenderAppender(PageContext pc) {
+ _pc = pc;
+ }
+
+ public void setPageContext(PageContext pc) {
+ _pc = pc;
+ }
+
+ public void append(String s) {
+ try {
+ ResponseUtils.write(_pc, s);
+ }
+ catch (JspException e) {
+ logger.error(Bundle.getString("Tags_WriteException"), e);
+ }
+ }
+
+}
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java Thu Nov 4 07:35:11 2004
@@ -622,8 +622,9 @@
_divState.clear();
_divState.styleClass = _treeClass;
_divState.style = _treeStyle;
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
TagRenderingBase divRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, request);
- divRenderer.doStartTag(sb, _divState);
+ divRenderer.doStartTag(writer, _divState);
sb.append("\n");
// Render the tree.
@@ -635,7 +636,7 @@
}
// finish the tree representation and write it
- divRenderer.doEndTag(sb);
+ divRenderer.doEndTag(writer);
sb.append("\n");
write(sb.toString());
}
@@ -726,7 +727,8 @@
_divState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, "netui-tree-level", Integer.toString(level));
}
sb.append(" ");
- divRenderer.doStartTag(sb, _divState);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ divRenderer.doStartTag(writer, _divState);
sb.append("\n");
// In devMode we will verify the structure of the tree. This will not run in
@@ -783,8 +785,8 @@
}
sb.append(" ");
_imgState.src = img.toString();
- imageRenderer.doStartTag(sb, _imgState);
- imageRenderer.doEndTag(sb);
+ imageRenderer.doStartTag(writer, _imgState);
+ imageRenderer.doEndTag(writer);
sb.append("\n");
}
@@ -830,12 +832,12 @@
_imgState.style = "vertical-align:middle;";
_imgState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, BORDER, "0");
_imgState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, "", false);
- imageRenderer.doStartTag(sb, _imgState);
- imageRenderer.doEndTag(sb);
+ imageRenderer.doStartTag(writer, _imgState);
+ imageRenderer.doEndTag(writer);
// close the anchor if one was openned...
if (closeAnchor)
- anchorRenderer.doEndTag(sb);
+ anchorRenderer.doEndTag(writer);
sb.append("\n");
// Calculate the selection link for this node, if the node is disabled, we can skip
@@ -909,7 +911,7 @@
// actually render the anchor.
sb.append(" ");
- anchorRenderer.doStartTag(sb, _anchorState);
+ anchorRenderer.doStartTag(writer, _anchorState);
endRender = anchorRenderer;
}
else {
@@ -919,7 +921,7 @@
_spanState.styleClass = _disabledClass;
_spanState.style = _disabledStyle;
sb.append(" ");
- spanRenderer.doStartTag(sb, _spanState);
+ spanRenderer.doStartTag(writer, _spanState);
endRender = spanRenderer;
}
sb.append(" ");
@@ -945,8 +947,8 @@
// set the inheritted attributes
attrs.renderIconImage(_imgState, node);
- imageRenderer.doStartTag(sb, _imgState);
- imageRenderer.doEndTag(sb);
+ imageRenderer.doStartTag(writer, _imgState);
+ imageRenderer.doEndTag(writer);
sb.append(" ");
}
@@ -956,7 +958,7 @@
sb.append(label);
sb.append(" ");
}
- endRender.doEndTag(sb);
+ endRender.doEndTag(writer);
// if there is content then we should render that here...
String ctnt = node.getContent();
@@ -967,7 +969,7 @@
// Render the end of this node
sb.append("\n ");
- divRenderer.doEndTag(sb);
+ divRenderer.doEndTag(writer);
sb.append("\n");
// now remove all of the attributes scoped with this...
@@ -1022,7 +1024,8 @@
_anchorState.href = action;
_anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TARGET, _iState.getExpandTarget());
sb.append(" ");
- anchorRenderer.doStartTag(sb, _anchorState);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ anchorRenderer.doStartTag(writer, _anchorState);
ret = true;
}
return ret;
@@ -1051,7 +1054,8 @@
_anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TreeElement.TREE_ANCHOR_ID, encodedNodeName);
sb.append(" ");
- anchorRenderer.doStartTag(sb, _anchorState);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ anchorRenderer.doStartTag(writer, _anchorState);
return true;
}
return false;
Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/B35084b.xml
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/B35084b.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/B35084b.xml Thu Nov 4 07:35:11 2004
@@ -2,7 +2,7 @@
<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
<ses:sessionName>B35084b</ses:sessionName>
<ses:tester>Daryl</ses:tester>
- <ses:startDate>24 Jul 2004, 05:32:43.369 PM MDT</ses:startDate>
+ <ses:startDate>03 Nov 2004, 10:35:11.409 PM MST</ses:startDate>
<ses:description>Daryl</ses:description>
<ses:tests>
<ses:test>
@@ -15,7 +15,12 @@
<ses:uri>/coreWeb/bugs/b35084b/Controller.jpf</ses:uri>
<ses:method>GET</ses:method>
<ses:parameters/>
- <ses:cookies/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>8ABE579CFB46D29BDC1A7A62465AE8D1</ses:value>
+ </ses:cookie>
+ </ses:cookies>
<ses:headers>
<ses:header>
<ses:name>accept</ses:name>
@@ -34,6 +39,10 @@
<ses:value>Keep-Alive, TE</ses:value>
</ses:header>
<ses:header>
+ <ses:name>cookie</ses:name>
+ <ses:value>$Version=0; JSESSIONID=8ABE579CFB46D29BDC1A7A62465AE8D1; $Path=/coreWeb</ses:value>
+ </ses:header>
+ <ses:header>
<ses:name>cookie2</ses:name>
<ses:value>$Version="1"</ses:value>
</ses:header>
@@ -47,7 +56,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>4b58bc9d:fdf37c62e7:-7f24</ses:value>
+ <ses:value>5286fdaf:1000210f30d:-7f25</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -89,7 +98,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>DA0DECAC50FB220484BDB61B89ADA96D</ses:value>
+ <ses:value>8ABE579CFB46D29BDC1A7A62465AE8D1</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -111,7 +120,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0; JSESSIONID=DA0DECAC50FB220484BDB61B89ADA96D; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0; JSESSIONID=8ABE579CFB46D29BDC1A7A62465AE8D1; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>cookie2</ses:name>
@@ -127,7 +136,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>4b58bc9d:fdf37c62e7:-7f24</ses:value>
+ <ses:value>5286fdaf:1000210f30d:-7f25</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -159,6 +168,8 @@
<tr><th>Tag Error</th><th>Message</th><td colspan="3">Action 'beginbogus' is not a valid action.</td></tr>
</table></span>
+ !!!!
+ <a href="/coreWeb/bugs/b35084b/next.do" onclick='anchor_submit_form("Netui_Form_0","/coreWeb/bugs/b35084b/next.do");return false;'><img src="/coreWeb/bugs/b35084b/../../resources/images/insert.gif"></a>
<script language="JavaScript" type="text/JavaScript">
<!--
@@ -180,8 +191,6 @@
</script>
- !!!!
- <a href="/coreWeb/bugs/b35084b/next.do" onclick='anchor_submit_form("Netui_Form_0","/coreWeb/bugs/b35084b/next.do");return false;'><img src="/coreWeb/bugs/b35084b/../../resources/images/insert.gif"></a>
</td>
</tr>
</table>
@@ -194,9 +203,9 @@
</ses:testResults>
</ses:test>
</ses:tests>
- <ses:endDate>24 Jul 2004, 05:32:47.004 PM MDT</ses:endDate>
+ <ses:endDate>03 Nov 2004, 10:35:14.533 PM MST</ses:endDate>
<ses:sessionStatus>fail</ses:sessionStatus>
<ses:testCount>2</ses:testCount>
<ses:passedCount>1</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
+</ses:recorderSession>
\ No newline at end of file