You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cr...@apache.org on 2007/02/27 23:49:40 UTC

svn commit: r512469 - in /beehive/trunk/netui: src/tags-html/org/apache/beehive/netui/tags/html/ src/tags-html/org/apache/beehive/netui/tags/javascript/ test/webapps/drt/src/tags/rewriteNameForTagId/ test/webapps/drt/src/tags/rewriteTags/ test/webapps/...

Author: crogers
Date: Tue Feb 27 14:49:38 2007
New Revision: 512469

URL: http://svn.apache.org/viewvc?view=rev&rev=512469
Log:
Implemented a new attribute, forTagId, for the netui:rewriteName tag to rewrite the name using the tag id scoping within the page rather than the URLRewriting (BEEHIVE-1179). Includes a new test recorder test case.

Tests: NetUI BVT (WinXP passed)

Added:
    beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/
    beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java   (with props)
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml   (with props)
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp   (with props)
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp   (with props)
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp   (with props)
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp   (with props)
Modified:
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
    beehive/trunk/netui/test/webapps/drt/src/tags/rewriteTags/Controller.java
    beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteTags.xml
    beehive/trunk/netui/test/webapps/drt/web/tags/rewriteTags/index.jsp

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteName.java Tue Feb 27 14:49:38 2007
@@ -18,38 +18,67 @@
  */
 package org.apache.beehive.netui.tags.html;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
 import org.apache.beehive.netui.tags.AbstractClassicTag;
 import org.apache.beehive.netui.tags.TagConfig;
 import org.apache.beehive.netui.tags.javascript.IScriptReporter;
 import org.apache.beehive.netui.tags.javascript.ScriptRequestState;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
-
 /**
- * Allow a name, typically either an <code>id</code> or <code>name</code> attribute, to participate in URL
- * rewritting.  Some containers rewrite name attributes so they are unique.
- * This tag will cause the name to be made available from <code>lookupIdByTagId</code>
- * JavaScript, which is output from the &lt;netui:html&gt; tag.
- * @jsptagref.tagdescription Allows a name, typically either an <code>id</code> or <code>name</code> attribute,
- * to participate in URL rewritting.  Some containers rewrite name attributes so they are unique.
- * This tag will cause the name to be made available from the <code>lookupIdByTagId( id, tag )</code>
- * JavaScript function.
- * @example In this sample, we are setting 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
- * render &lt;span name="scope1_foo"> instead of &lt;span name="foo">.
- * But the value 'foo' can be passed to <code>lookupIdByTagId( id, tag )</code> to find the rendered
- * value of the name attribute.
+ * Allows a name, typically either a URL parameter <code>name</code> or tag
+ * <code>id</code>, to participate in some form of rewriting.  By default
+ * the name participates in URL rewriting for query parameters. If the
+ * <code>forTagId</code> attribute is true, then the name is rewritten for
+ * NetUI client side JavaScript scoping facilities that ensure an HTML tag
+ * id attribute is unique in the page. In this case it can be used by client
+ * side JavaScript to look up tag elements in the document using the NetUI
+ * JavaScript routine, <code>lookupIdByTagId( tagId, tag )</code>, which is
+ * output from the &lt;netui:html&gt; and &lt;netui:scriptContainer&gt; tags.
+ *
+ * <p>
+ * Note that the real name rendered in the browser may be changed by the
+ * application container (for example, Portal containers may change the
+ * rendered value to ensure the uniqueness of an URL parameter name or tag
+ * id attribute on the page).
+ * </p>
+ *
+ * @jsptagref.tagdescription Allows a name, typically
+ * either a URL parameter <code>name</code> or tag
+ * <code>id</code>, to participate in some form of rewriting.  By default
+ * the name participates in URL rewriting for query parameters. If the
+ * <code>forTagId</code> attribute is true, then the name is rewritten for
+ * NetUI client side JavaScript scoping facilities that ensure an HTML tag
+ * id attribute is unique in the page. In this case it can be used by client
+ * side JavaScript to look up tag elements in the document using the NetUI
+ * JavaScript routine, <code>lookupIdByTagId( tagId, tag )</code>, which is
+ * output from the &lt;netui:html&gt; and &lt;netui:scriptContainer&gt; tags.
+ *
+ * <p>
+ * Note that the real name rendered in the browser may be changed by the
+ * application container (for example, Portal containers may change the
+ * rendered value to ensure the uniqueness of an URL parameter name or tag
+ * id attribute on the page).
+ * </p>
  *
- * <pre>    &lt;span id="&lt;netui:rewriteName name="foo"/&gt;"&gt;</pre>
- * @netui:tag name="rewriteName" description="Allows the URL Rewriter to rewrite the name attribute before it is output into the HTML stream."
+ * @example In this sample, we are setting the id attribute of the span tag to
+ * 'foo'.  The actual value (the real id) that will be rendered in the HTML
+ * may change depending on the container where the web application resides.
+ * For example, a Portal container may render &lt;span id="scope1.foo">
+ * instead of &lt;span name="foo">. But the value 'foo' can be passed to
+ * <code>lookupIdByTagId( "foo", tag )</code> to find the rendered
+ * value of the id attribute.
+ *
+ * <pre>    &lt;span id="&lt;netui:rewriteName name="foo"  forTagId="true"/&gt;"&gt;</pre>
+ * @netui:tag name="rewriteName" description="Allows a URL parameter name or tag id attribute to participate in rewriting before it is output into the HTML stream."
  */
 public class RewriteName
         extends AbstractClassicTag
 {
     private String _name = null;
     private String _resultId = null;
+    private boolean _forTagId = false;
 
     /**
      * Return the name of the Tag.
@@ -89,13 +118,41 @@
     }
 
     /**
+     * If <code>true</code>, then the name is rewritten for NetUI client
+     * side JavaScript scoping facilities that ensure an HTML tag
+     * id attribute is unique in the page. In this case, the real tag id
+     * rendered in the page may be looked up through the NetUI JavaScript
+     * function <code>lookupIdByTagId( tagId, tag )</code>.
+     * @param forTagId if <code>true</code>, rewrites the name for an HTML
+     *                 tag id attribute that is unique in the page.
+     * @jsptagref.attributedescription Boolean. Whether the name is rewritten
+     * for an HTML tag id attribute that is unique in the page.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>boolean_forTagId</i>
+     * @netui:attribute required="false" rtexprvalue="true" type="boolean"
+     * description="Whether the name is rewritten for an HTML tag id attribute
+     * that is unique in the page."
+     */
+    public void setForTagId(boolean forTagId)
+    {
+        _forTagId = forTagId;
+    }
+
+    /**
      * Pass the name attribute to the URLRewriter and output the
      * returned value.  Updates the HTML tag to output the mapping.
      * @throws JspException if a JSP exception has occurred
      */
     public int doStartTag() throws JspException
     {
-        String realName = rewriteName(_name);
+        String realName = null;
+        if (_forTagId) {
+            realName = getIdForTagId(_name);
+        }
+        else {
+            realName = rewriteName(_name);
+        }
+
         if (_resultId != null)
             pageContext.setAttribute(_resultId, realName);
 

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java Tue Feb 27 14:49:38 2007
@@ -18,7 +18,11 @@
  */
 package org.apache.beehive.netui.tags.javascript;
 
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.RequestUtils;
 import org.apache.beehive.netui.tags.TagConfig;
@@ -26,23 +30,18 @@
 import org.apache.beehive.netui.tags.rendering.ScriptTag;
 import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
 import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import java.io.Serializable;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
 
 /**
- * Provides tag specific support for the HTML tags so they can create JavaScript.  There is a bundle
- * which contains all of the Java Script.  This bundle will be cached inside this class.  THe properties
- * file does not get i18n support.
+ * Provides tag specific support for the HTML tags so they can create JavaScript.
+ * There is a bundle which contains all of the Java Script.  This bundle will be
+ * cached inside this class.  The properties file does not get I18N support.
  */
 public class ScriptRequestState implements Serializable
 {
     /**
-     * This is the name of a request scoped attribute that contains the status of what JavaScript processing
-     * has taken place.
+     * This is the name of a request scoped attribute that contains the status
+     * of what JavaScript processing has taken place.
      */
     public static final String JAVASCRIPT_STATUS = "netui.javascript.status";
 
@@ -157,11 +156,19 @@
     }
 
     /**
-     * @param scriptReporter
-     * @param tagId
-     * @param realId
-     * @param realName
-     * @return String
+     * This method will add a tagId and real tag name to a JavaScript TagId map.
+     * The ScriptContainer tag will create a JavaScript table that allows
+     * the container, such as a portal, to rewrite the id so it's unique.
+     * The real name may be looked up based upon the tagId.
+     * <p>
+     * If no ScriptReporter is found, a script string will be returned
+     * to the caller so they can output the script block.
+     * </p>
+     * @param scriptReporter a container for handling the generated JavaScript.
+     * @param tagId    the tagId of a tag.
+     * @param realId   the real tag id.
+     * @param realName the real name of tag.
+     * @return String  the script for a script block if there's no IScriptReporter
      */
     public String mapTagId(IScriptReporter scriptReporter, String tagId, String realId, String realName)
     {
@@ -170,7 +177,8 @@
             return null;
         }
 
-        // without a scripRepoter we need to create the actual JavaScript that will be written out
+        // without a scriptReporter we need to create the actual JavaScript
+        // that will be written out
         InternalStringBuilder sb = new InternalStringBuilder(128);
         StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
         getTagIdMapping(tagId, realId, realName, writer);
@@ -178,16 +186,11 @@
     }
 
     /**
-     * This method will add a tagId and value to the ScriptRepoter TagId map.
-     * The a ScriptContainer tag will create a JavaScript table that allows
-     * the container, such as a portal, to rewrite the id so it's unique.
-     * The real name may be looked up based  upon the tagId.
-     *
-     * If the no ScriptReporter is found, a script string will be returned
-     * to the caller so they can output the script block.
-     * @param tagId
-     * @param value
-     * @return String
+     * This is the legacy version of {@link #mapTagId}.
+     * @param scriptReporter a container for handling the generated JavaScript.
+     * @param tagId    the tagId of a tag.
+     * @param value    the real name of a tag.
+     * @return String  the script for a script block if there's no IScriptReporter
      */
     public String mapLegacyTagId(IScriptReporter scriptReporter, String tagId, String value)
     {
@@ -196,7 +199,8 @@
             return null;
         }
 
-        // without a scripRepoter we need to create the actual JavaScript that will be written out
+        // without a scriptReporter we need to create the actual JavaScript
+        // that will be written out
         InternalStringBuilder sb = new InternalStringBuilder(64);
         StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
         getTagIdMapping(tagId, value, writer);

Added: beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java (added)
+++ beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java Tue Feb 27 14:49:38 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package tags.rewriteNameForTagId;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import java.io.Serializable;
+
+@Jpf.Controller(
+    simpleActions = {
+        @Jpf.SimpleAction(name = "begin", path = "indexFrag.jsp"),
+        @Jpf.SimpleAction(name = "beginFullPage", path = "index.jsp")
+    }
+)
+public class Controller extends PageFlowController
+{
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(name = "success", path = "results.jsp")
+        }
+    )
+    public Forward test(TestBean form) {
+        Forward forward = new Forward("success");
+        forward.addActionOutput("resultId", form.getId());
+        return forward;
+    }
+
+    @Jpf.FormBean()
+    public static class TestBean implements Serializable
+    {
+        private String _id;
+        public String getId() { return _id; }
+        public void setId(String id) { _id = id; }
+    }
+}

Propchange: beehive/trunk/netui/test/webapps/drt/src/tags/rewriteNameForTagId/Controller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/netui/test/webapps/drt/src/tags/rewriteTags/Controller.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/src/tags/rewriteTags/Controller.java?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/src/tags/rewriteTags/Controller.java (original)
+++ beehive/trunk/netui/test/webapps/drt/src/tags/rewriteTags/Controller.java Tue Feb 27 14:49:38 2007
@@ -16,81 +16,17 @@
  *
  * $Header:$
  */
-// ------------------------------------------------------------------------------
-//  Generated by WebLogic Workshop
-// 
-//  Created on: Wed Aug 06 10:01:17 MDT 2003
-//  By: dolander
-// -----------------------------------------------------------------------------
 package tags.rewriteTags;
+
 import org.apache.beehive.netui.pageflow.Forward;
 import org.apache.beehive.netui.pageflow.PageFlowController;
 import org.apache.beehive.netui.pageflow.annotations.Jpf;
 
-/**
- * @jpf:controller
- * @jpf:view-properties view-properties::
- * <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
- * <view-properties>
- * <pageflow-object id="pageflow:/rewriteTags/Controller.jpf"/>
- * <pageflow-object id="action:begin.do">
- *   <property value="80" name="x"/>
- *   <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="page:index.jsp">
- *   <property value="240" name="x"/>
- *   <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
- *   <property value="116,160,160,204" name="elbowsX"/>
- *   <property value="92,92,92,92" name="elbowsY"/>
- *   <property value="East_1" name="fromPort"/>
- *   <property value="West_1" name="toPort"/>
- *   <property value="success" name="label"/>
- * </pageflow-object>
- * </view-properties>
- * ::
- */
-@Jpf.Controller(
-    )
-@Jpf.ViewProperties(
-    value = {
-        "<!-- This data is auto-generated. Hand-editing this section is not recommended. -->",
-        "<view-properties>",
-        "<pageflow-object id='pageflow:/rewriteTags/Controller.jpf'/>",
-        "<pageflow-object id='action:begin.do'>",
-        "  <property value='80' name='x'/>",
-        "  <property value='100' name='y'/>",
-        "</pageflow-object>",
-        "<pageflow-object id='page:index.jsp'>",
-        "  <property value='240' name='x'/>",
-        "  <property value='100' name='y'/>",
-        "</pageflow-object>",
-        "<pageflow-object id='forward:path#success#index.jsp#@action:begin.do@'>",
-        "  <property value='116,160,160,204' name='elbowsX'/>",
-        "  <property value='92,92,92,92' name='elbowsY'/>",
-        "  <property value='East_1' name='fromPort'/>",
-        "  <property value='West_1' name='toPort'/>",
-        "  <property value='success' name='label'/>",
-        "</pageflow-object>",
-        "</view-properties>"
-    })
+@Jpf.Controller()
 public class Controller extends PageFlowController
 {
-
-
-    // Uncomment this declaration to access Global.app.
-    // 
-    //     protected global.Global globalApp;
-    // 
-
-    // For an example of page flow exception handling see the example "catch" and "exception-handler"
-    // annotations in {project}/WEB-INF/src/global/Global.app
-
     /**
      * This method represents the point of entry into the pageflow
-     * @jpf:action
-     * @jpf:forward name="success" path="index.jsp"
      */
     @Jpf.Action(
         forwards = {

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Tue Feb 27 14:49:38 2007
@@ -7105,6 +7105,19 @@
          </features>
       </test>
       <test>
+         <name>RewriteNameForTagId</name>
+         <description>rewriteName tag with forTagId set to true. (BEEHIVE-1179)</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>bvt.struts11</category>
+            <category>tags</category>
+         </categories>
+         <features>
+            <feature>RewriteName</feature>
+         </features>
+      </test>
+      <test>
          <name>RewriteNameVar</name>
          <description>Verify that the resultID attribute.</description>
          <webapp>coreWeb</webapp>

Added: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml (added)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml Tue Feb 27 14:49:38 2007
@@ -0,0 +1,886 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<recorderSession xmlns="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+<sessionName>RewriteNameForTagId</sessionName>
+<tester>crogers</tester>
+<startDate>27 Feb 2007, 01:29:18.380 AM MST</startDate>
+<description>rewriteName tag with forTagId set to true. (BEEHIVE-1179)</description>
+<tests>
+<test>
+<testNumber>1</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/tags/rewriteNameForTagId/index.jsp</uri>
+<method>GET</method>
+<parameters>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>D1EEBEF2B304288B9A042311FBC66D4E</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>accept</name>
+<value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
+</header>
+<header>
+<name>accept-charset</name>
+<value>UTF-8,*</value>
+</header>
+<header>
+<name>accept-encoding</name>
+<value>gzip, deflate</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us,en;q=0.5</value>
+</header>
+<header>
+<name>connection</name>
+<value>keep-alive</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>keep-alive</name>
+<value>300</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en" netui:idScope="n0">
+
+    <head>
+        <title>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</title>
+        <script language="JavaScript" type="text/JavaScript" src="/coreWeb/resources/beehive/version1/javascript/netui-tree.js"></script>
+    </head>
+    <body>
+
+        <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+        <div id="n0.testElem">
+            <p>
+                This paragraph element is within a div tag with an id created
+                using the attribute, forTagId=&quot;true&quot;, like...
+                <br>
+                <code>
+                    &lt;div id=&quot;&lt;netui:rewriteName
+                    name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+                </code>
+            </p>
+        </div>
+
+        <form name="n0.myForm" id="n0.myForm" action="/coreWeb/tags/rewriteNameForTagId/test.do" method="post">
+            <input type="hidden" id="n0.myInput" name="{actionForm.id}" value="place-holder">
+            <input type="submit" value="Run the test" onclick="processForm(this.form);">
+        </form>
+
+        
+    </body>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// write out the webapp name
+netUI.webAppName = "/coreWeb";
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.n0__testElem="n0.testElem"
+netui_names.n0__myInput="{actionForm.id}"
+netui_names.n0__myForm="n0.myForm"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+   var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.n0___myInput="{actionForm.id}"
+netui_tagIdNameMap.n0___myForm="n0.myForm"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a idScope.
+// The first idScope found will be returned or the empty string if a idScope is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   try {
+      var attrVal = tag.getAttribute("netui:idScope");
+   } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,"_");
+   if (idScope == "")
+      return netui_tagIdNameMap[id];
+   else
+      return netui_tagIdNameMap[idScope  + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null && tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+</script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+        function processForm(element) {
+            var tagId = "testElem";
+            var realId = lookupIdByTagId(tagId, element);
+            var testElem = document.getElementById(realId);
+            alert("Node type = " + testElem.nodeName
+                  + "\ntagID = " + tagId
+                  + "\nreal Id = " + realId);
+            alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+            var inputId = lookupIdByTagId("myInput", element);
+            var inputElem = document.getElementById(inputId);
+            inputElem.value = realId;
+        }
+        
+
+-->
+</script>
+
+</html>]]>
+</responseBody>
+</response>
+</test>
+<test>
+<testNumber>2</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/tags/rewriteNameForTagId/test.do</uri>
+<method>POST</method>
+<parameters>
+<parameter>
+<name>{actionForm.id}</name>
+<value>n0.testElem</value>
+</parameter>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>D1EEBEF2B304288B9A042311FBC66D4E</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>accept</name>
+<value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
+</header>
+<header>
+<name>accept-charset</name>
+<value>UTF-8,*</value>
+</header>
+<header>
+<name>accept-encoding</name>
+<value>gzip, deflate</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us,en;q=0.5</value>
+</header>
+<header>
+<name>connection</name>
+<value>keep-alive</value>
+</header>
+<header>
+<name>content-length</name>
+<value>31</value>
+</header>
+<header>
+<name>content-type</name>
+<value>application/x-www-form-urlencoded</value>
+</header>
+<header>
+<name>cookie</name>
+<value>JSESSIONID=D1EEBEF2B304288B9A042311FBC66D4E</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>keep-alive</name>
+<value>300</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+    <head>
+        <title>results</title>
+    </head>
+    <body>
+        <p>
+            The client side Javascript found and submitted the following
+            div tag id...
+        </p>
+        <p>
+            ID: n0.testElem
+        </p>
+    </body>
+
+</html>]]>
+</responseBody>
+</response>
+</test>
+<test>
+<testNumber>3</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/tags/rewriteNameForTagId/MockPortal.jsp</uri>
+<method>GET</method>
+<parameters>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>D1EEBEF2B304288B9A042311FBC66D4E</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>accept</name>
+<value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
+</header>
+<header>
+<name>accept-charset</name>
+<value>UTF-8,*</value>
+</header>
+<header>
+<name>accept-encoding</name>
+<value>gzip, deflate</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us,en;q=0.5</value>
+</header>
+<header>
+<name>connection</name>
+<value>keep-alive</value>
+</header>
+<header>
+<name>cookie</name>
+<value>JSESSIONID=D1EEBEF2B304288B9A042311FBC66D4E</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>keep-alive</name>
+<value>300</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<html>
+<head>
+<title>Mock Portal (/mockportal)</title>
+</head>
+
+<h3>Mock Portal (/mockportal)</h3>
+<body>
+
+    <table border="1" cellspacing="1" cellpadding="5" width="100%">
+<tr bordercolor="White"><td bgcolor="#EEEEFF">
+<b>Portlet portletA</b></td></tr><tr bordercolor="White"><td bgcolor="#EEEEFF">
+<font color="green">Action was: <b>begin</b></font><br>
+<font color="green">Action result URI: <b>/tags/rewriteNameForTagId/indexFrag.jsp</b></font><br>
+<font color="green">Action result isRedirect: <b>false</b></font><br>
+<font color="green">Action result isError: <b>false</b></font><br>
+<font color="green">Action result statusCode: <b>-1</b></font><br>
+<font color="green">Action result statusMessage: <b>[none]</b></font><br>
+<font color="black">PageFlow/StrutsModule type: <b>tags.rewriteNameForTagId.Controller</b></font><br>
+<font color="black">Current URL: <b>/tags/rewriteNameForTagId/indexFrag.jsp</b></font><br>
+</td></tr>
+<tr><td>
+
+
+
+
+<div netui:idScope="portletA" >
+    <script language="JavaScript" type="text/JavaScript" src="/coreWeb/resources/beehive/version1/javascript/netui-tree.js"></script>
+    <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+    <div id="portletA.testElem">
+        <p>
+            This paragraph element is within a div tag with an id created
+            using the attribute, forTagId=&quot;true&quot;, like...
+            <br>
+            <code>
+                &lt;div id=&quot;&lt;netui:rewriteName
+                name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+            </code>
+        </p>
+    </div>
+
+    <form name="portletA.myForm" id="portletA.myForm" action="/coreWeb/tags/rewriteNameForTagId/MockPortal.jsp?portletAaltAction=test&amp;portletA_submit=true" method="post">
+        <input type="hidden" id="portletA.myInput" name="portletA{actionForm.id}" value="place-holder">
+        <input type="submit" value="Run the test" onclick="processForm(this.form);">
+    </form>
+
+    
+</div><script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// write out the webapp name
+netUI.webAppName = "/coreWeb";
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.portletA__testElem="portletA.testElem"
+netui_names.portletA__myInput="portletA{actionForm.id}"
+netui_names.portletA__myForm="portletA.myForm"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+   var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.portletA___myInput="portletA{actionForm.id}"
+netui_tagIdNameMap.portletA___myForm="portletA.myForm"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a idScope.
+// The first idScope found will be returned or the empty string if a idScope is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   try {
+      var attrVal = tag.getAttribute("netui:idScope");
+   } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,"_");
+   if (idScope == "")
+      return netui_tagIdNameMap[id];
+   else
+      return netui_tagIdNameMap[idScope  + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null && tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+</script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+    function processForm(element) {
+        var tagId = "testElem";
+        var realId = lookupIdByTagId(tagId, element);
+        var testElem = document.getElementById(realId);
+        alert("Node type = " + testElem.nodeName
+              + "\ntagID = " + tagId
+              + "\nreal Id = " + realId);
+        alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+        var inputId = lookupIdByTagId("myInput", element);
+        var inputElem = document.getElementById(inputId);
+        inputElem.value = realId;
+    }
+    
+
+-->
+</script>
+
+</td></tr>
+</table><br><br>
+<table border="1" cellspacing="1" cellpadding="5" width="100%">
+<tr bordercolor="White"><td bgcolor="#EEEEFF">
+<b>Portlet portletB</b></td></tr><tr bordercolor="White"><td bgcolor="#EEEEFF">
+<font color="green">Action was: <b>begin</b></font><br>
+<font color="green">Action result URI: <b>/tags/rewriteNameForTagId/indexFrag.jsp</b></font><br>
+<font color="green">Action result isRedirect: <b>false</b></font><br>
+<font color="green">Action result isError: <b>false</b></font><br>
+<font color="green">Action result statusCode: <b>-1</b></font><br>
+<font color="green">Action result statusMessage: <b>[none]</b></font><br>
+<font color="black">PageFlow/StrutsModule type: <b>tags.rewriteNameForTagId.Controller</b></font><br>
+<font color="black">Current URL: <b>/tags/rewriteNameForTagId/indexFrag.jsp</b></font><br>
+</td></tr>
+<tr><td>
+
+
+
+
+<div netui:idScope="portletB" >
+    <script language="JavaScript" type="text/JavaScript" src="/coreWeb/resources/beehive/version1/javascript/netui-tree.js"></script>
+    <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+    <div id="portletB.testElem">
+        <p>
+            This paragraph element is within a div tag with an id created
+            using the attribute, forTagId=&quot;true&quot;, like...
+            <br>
+            <code>
+                &lt;div id=&quot;&lt;netui:rewriteName
+                name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+            </code>
+        </p>
+    </div>
+
+    <form name="portletB.myForm" id="portletB.myForm" action="/coreWeb/tags/rewriteNameForTagId/MockPortal.jsp?portletBaltAction=test&amp;portletB_submit=true" method="post">
+        <input type="hidden" id="portletB.myInput" name="portletB{actionForm.id}" value="place-holder">
+        <input type="submit" value="Run the test" onclick="processForm(this.form);">
+    </form>
+
+    
+</div><script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.portletB__testElem="portletB.testElem"
+netui_names.portletB__myInput="portletB{actionForm.id}"
+netui_names.portletB__myForm="portletB.myForm"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+   var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.portletB___myInput="portletB{actionForm.id}"
+netui_tagIdNameMap.portletB___myForm="portletB.myForm"
+
+-->
+</script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+    function processForm(element) {
+        var tagId = "testElem";
+        var realId = lookupIdByTagId(tagId, element);
+        var testElem = document.getElementById(realId);
+        alert("Node type = " + testElem.nodeName
+              + "\ntagID = " + tagId
+              + "\nreal Id = " + realId);
+        alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+        var inputId = lookupIdByTagId("myInput", element);
+        var inputElem = document.getElementById(inputId);
+        inputElem.value = realId;
+    }
+    
+
+-->
+</script>
+
+</td></tr>
+</table><br><br>
+
+        
+        
+    
+
+</body>
+</html>]]>
+</responseBody>
+</response>
+</test>
+<test>
+<testNumber>4</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/tags/rewriteNameForTagId/MockPortal.jsp</uri>
+<method>POST</method>
+<parameters>
+<parameter>
+<name>portletB_submit</name>
+<value>true</value>
+</parameter>
+<parameter>
+<name>portletBaltAction</name>
+<value>test</value>
+</parameter>
+<parameter>
+<name>portletB{actionForm.id}</name>
+<value>portletB.testElem</value>
+</parameter>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>D1EEBEF2B304288B9A042311FBC66D4E</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>accept</name>
+<value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
+</header>
+<header>
+<name>accept-charset</name>
+<value>UTF-8,*</value>
+</header>
+<header>
+<name>accept-encoding</name>
+<value>gzip, deflate</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us,en;q=0.5</value>
+</header>
+<header>
+<name>connection</name>
+<value>keep-alive</value>
+</header>
+<header>
+<name>content-length</name>
+<value>45</value>
+</header>
+<header>
+<name>content-type</name>
+<value>application/x-www-form-urlencoded</value>
+</header>
+<header>
+<name>cookie</name>
+<value>JSESSIONID=D1EEBEF2B304288B9A042311FBC66D4E</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>keep-alive</name>
+<value>300</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<html>
+<head>
+<title>Mock Portal (/mockportal)</title>
+</head>
+
+<h3>Mock Portal (/mockportal)</h3>
+<body>
+
+    <table border="1" cellspacing="1" cellpadding="5" width="100%">
+<tr bordercolor="White"><td bgcolor="#EEEEFF">
+<b>Portlet portletA</b></td></tr><tr bordercolor="White"><td bgcolor="#EEEEFF">
+<font color="black">PageFlow/StrutsModule type: <b>tags.rewriteNameForTagId.Controller</b></font><br>
+<font color="black">Current URL: <b>/tags/rewriteNameForTagId/indexFrag.jsp</b></font><br>
+</td></tr>
+<tr><td>
+
+
+
+
+<div netui:idScope="portletA" >
+    <script language="JavaScript" type="text/JavaScript" src="/coreWeb/resources/beehive/version1/javascript/netui-tree.js"></script>
+    <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+    <div id="portletA.testElem">
+        <p>
+            This paragraph element is within a div tag with an id created
+            using the attribute, forTagId=&quot;true&quot;, like...
+            <br>
+            <code>
+                &lt;div id=&quot;&lt;netui:rewriteName
+                name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+            </code>
+        </p>
+    </div>
+
+    <form name="portletA.myForm" id="portletA.myForm" action="/coreWeb/tags/rewriteNameForTagId/MockPortal.jsp?portletAaltAction=test&amp;portletA_submit=true" method="post">
+        <input type="hidden" id="portletA.myInput" name="portletA{actionForm.id}" value="place-holder">
+        <input type="submit" value="Run the test" onclick="processForm(this.form);">
+    </form>
+
+    
+</div><script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// write out the webapp name
+netUI.webAppName = "/coreWeb";
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.portletA__testElem="portletA.testElem"
+netui_names.portletA__myInput="portletA{actionForm.id}"
+netui_names.portletA__myForm="portletA.myForm"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+   var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.portletA___myInput="portletA{actionForm.id}"
+netui_tagIdNameMap.portletA___myForm="portletA.myForm"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a idScope.
+// The first idScope found will be returned or the empty string if a idScope is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   try {
+      var attrVal = tag.getAttribute("netui:idScope");
+   } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,"_");
+   if (idScope == "")
+      return netui_tagIdNameMap[id];
+   else
+      return netui_tagIdNameMap[idScope  + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null && tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+</script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+    function processForm(element) {
+        var tagId = "testElem";
+        var realId = lookupIdByTagId(tagId, element);
+        var testElem = document.getElementById(realId);
+        alert("Node type = " + testElem.nodeName
+              + "\ntagID = " + tagId
+              + "\nreal Id = " + realId);
+        alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+        var inputId = lookupIdByTagId("myInput", element);
+        var inputElem = document.getElementById(inputId);
+        inputElem.value = realId;
+    }
+    
+
+-->
+</script>
+
+</td></tr>
+</table><br><br>
+<table border="1" cellspacing="1" cellpadding="5" width="100%">
+<tr bordercolor="White"><td bgcolor="#EEEEFF">
+<b>Portlet portletB</b></td></tr><tr bordercolor="White"><td bgcolor="#EEEEFF">
+<font color="green">Action was: <b>test</b></font><br>
+<font color="green">Action result URI: <b>/tags/rewriteNameForTagId/results.jsp</b></font><br>
+<font color="green">Action result isRedirect: <b>false</b></font><br>
+<font color="green">Action result isError: <b>false</b></font><br>
+<font color="green">Action result statusCode: <b>-1</b></font><br>
+<font color="green">Action result statusMessage: <b>[none]</b></font><br>
+<font color="black">PageFlow/StrutsModule type: <b>tags.rewriteNameForTagId.Controller</b></font><br>
+<font color="black">Current URL: <b>/tags/rewriteNameForTagId/results.jsp</b></font><br>
+</td></tr>
+<tr><td>
+
+
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en" netui:idScope="portletB">
+
+    <head>
+        <title>results</title>
+    </head>
+    <body>
+        <p>
+            The client side Javascript found and submitted the following
+            div tag id...
+        </p>
+        <p>
+            ID: portletB.testElem
+        </p>
+    </body>
+</html>
+</td></tr>
+</table><br><br>
+
+        
+        
+    
+
+</body>
+</html>]]>
+</responseBody>
+</response>
+</test>
+</tests>
+<endDate>27 Feb 2007, 01:30:05.838 AM MST</endDate>
+<testCount>4</testCount>
+</recorderSession>

Propchange: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteNameForTagId.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteTags.xml
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteTags.xml?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteTags.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RewriteTags.xml Tue Feb 27 14:49:38 2007
@@ -67,10 +67,7 @@
          <ses:response>
             <ses:statusCode>200</ses:statusCode>
             <ses:reason/>
-            <ses:responseBody>&lt;!--Generated by WebLogic Workshop-->
-
-
-
+            <ses:responseBody>
 
 &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 	"http://www.w3.org/TR/html4/loose.dtd">

Added: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp (added)
+++ beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp Tue Feb 27 14:49:38 2007
@@ -0,0 +1,36 @@
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   $Header:$
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="mockportal.tld" prefix="mp" %>
+
+<html>
+<head>
+<title>Mock Portal (/mockportal)</title>
+</head>
+
+<h3>Mock Portal (/mockportal)</h3>
+<body>
+
+    <mp:mockPortal>
+        <mp:mockPortlet portletID="portletA" pageFlowURI="/tags/rewriteNameForTagId/Controller.jpf" verbose="true" />
+        <mp:mockPortlet portletID="portletB" pageFlowURI="/tags/rewriteNameForTagId/Controller.jpf" verbose="true" />
+    </mp:mockPortal>
+
+</body>
+</html>

Propchange: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/MockPortal.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp (added)
+++ beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp Tue Feb 27 14:49:38 2007
@@ -0,0 +1,67 @@
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   $Header:$
+--%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+
+<netui:html generateIdScope="true">
+    <head>
+        <title>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</title>
+        <netui:scriptHeader/>
+    </head>
+    <body>
+
+        <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+        <div id="<netui:rewriteName name='testElem' forTagId='true'/>">
+            <p>
+                This paragraph element is within a div tag with an id created
+                using the attribute, forTagId=&quot;true&quot;, like...
+                <br>
+                <code>
+                    &lt;div id=&quot;&lt;netui:rewriteName
+                    name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+                </code>
+            </p>
+        </div>
+
+        <netui:form tagId="myForm" action="test">
+            <netui:hidden tagId="myInput" dataInput="place-holder"
+                          dataSource="actionForm.id"/>
+            <netui:button type="submit" onClick="processForm(this.form);">
+                Run the test
+            </netui:button>
+        </netui:form>
+
+        <netui:scriptBlock placement="after">
+        function processForm(element) {
+            var tagId = "testElem";
+            var realId = lookupIdByTagId(tagId, element);
+            var testElem = document.getElementById(realId);
+            alert("Node type = " + testElem.nodeName
+                  + "\ntagID = " + tagId
+                  + "\nreal Id = " + realId);
+            alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+            var inputId = lookupIdByTagId("myInput", element);
+            var inputElem = document.getElementById(inputId);
+            inputElem.value = realId;
+        }
+        </netui:scriptBlock>
+    </body>
+</netui:html>

Propchange: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp (added)
+++ beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp Tue Feb 27 14:49:38 2007
@@ -0,0 +1,61 @@
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   $Header:$
+--%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+
+<netui:scriptContainer>
+    <netui:scriptHeader/>
+    <h3>Test &lt;netui:rewriteName&gt; With forTagId=&quot;true&quot;</h3>
+
+    <div id="<netui:rewriteName name='testElem' forTagId='true'/>">
+        <p>
+            This paragraph element is within a div tag with an id created
+            using the attribute, forTagId=&quot;true&quot;, like...
+            <br>
+            <code>
+                &lt;div id=&quot;&lt;netui:rewriteName
+                name='testElem' <b>forTagId='true'</b>/&gt;&quot;&gt;
+            </code>
+        </p>
+    </div>
+
+    <netui:form tagId="myForm" action="test">
+        <netui:hidden tagId="myInput" dataInput="place-holder"
+                      dataSource="actionForm.id"/>
+        <netui:button type="submit" onClick="processForm(this.form);">
+            Run the test
+        </netui:button>
+    </netui:form>
+
+    <netui:scriptBlock placement="after">
+    function processForm(element) {
+        var tagId = "testElem";
+        var realId = lookupIdByTagId(tagId, element);
+        var testElem = document.getElementById(realId);
+        alert("Node type = " + testElem.nodeName
+              + "\ntagID = " + tagId
+              + "\nreal Id = " + realId);
+        alert("(legacy) getNetuiTagName() = " + getNetuiTagName(tagId, element));
+
+        var inputId = lookupIdByTagId("myInput", element);
+        var inputElem = document.getElementById(inputId);
+        inputElem.value = realId;
+    }
+    </netui:scriptBlock>
+</netui:scriptContainer>

Propchange: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/indexFrag.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp?view=auto&rev=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp (added)
+++ beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp Tue Feb 27 14:49:38 2007
@@ -0,0 +1,35 @@
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   $Header:$
+--%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+
+<netui:html>
+    <head>
+        <title>results</title>
+    </head>
+    <netui:body>
+        <p>
+            The client side Javascript found and submitted the following
+            div tag id...
+        </p>
+        <p>
+            ID: ${pageInput.resultId}
+        </p>
+    </netui:body>
+</netui:html>

Propchange: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteNameForTagId/results.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/netui/test/webapps/drt/web/tags/rewriteTags/index.jsp
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/test/webapps/drt/web/tags/rewriteTags/index.jsp?view=diff&rev=512469&r1=512468&r2=512469
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/tags/rewriteTags/index.jsp (original)
+++ beehive/trunk/netui/test/webapps/drt/web/tags/rewriteTags/index.jsp Tue Feb 27 14:49:38 2007
@@ -1,8 +1,23 @@
-<!--Generated by WebLogic Workshop-->
+<%--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   $Header:$
+--%>
 <%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
 <%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
 <netui:html>
     <head>
         <title>