Author: dolander
Date: Sun Nov 14 16:04:59 2004
New Revision: 71473

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/rendering/AnchorTag.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AreaTag.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/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/THeadTag.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/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/ThTag.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TrTag.java
   incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
Log:
Add HTML Quirks mode support to the HTML Renderer.  The default is now Quirks 
mode.
Add a default configuration to the netui-config.xml file
Convert the BVT webapp to use HTML Loose as the default




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
    Sun Nov 14 16:04:59 2004
@@ -100,6 +100,11 @@
     public static final String HTML_401 = "html4-loose";
 
     /**
+     * Constant representing the document type html 4.01
+     */
+    public static final String HTML_401_QUIRKS = "html4-loose-quirks";
+
+    /**
      * Constant representing the document type XHTML 1.0 Transitional.
      */
     public static final String XHTML_10 = "xhtml1-transitional";
@@ -138,13 +143,15 @@
         if (_docType != null) {
             if (_docType.equals(HTML_401))
                 _rendering = TagRenderingBase.HTML_RENDERING;
+            else if (_docType.equals(HTML_401_QUIRKS))
+                _rendering = TagRenderingBase.HTML_RENDERING_QUIRKS;
             else if (_docType.equals(XHTML_10))
                 _rendering = TagRenderingBase.XHTML_RENDERING;
             else
-                _rendering = TagRenderingBase.HTML_RENDERING;
+                _rendering = TagRenderingBase.getDefaultDocType();
         }
         else {
-            _rendering = TagRenderingBase.HTML_RENDERING;
+            _rendering = TagRenderingBase.getDefaultDocType();
         }
         return _rendering;
     }

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
  Sun Nov 14 16:04:59 2004
@@ -32,9 +32,10 @@
      * @param html  The map of HTML Tag Renderers
      * @param xhtml The map of XHTML Tag Renderers
      */
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(ANCHOR_TAG, new Rendering());
+        htmlQuirks.put(ANCHOR_TAG, new Rendering());
         xhtml.put(ANCHOR_TAG, new Rendering());
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AreaTag.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AreaTag.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AreaTag.java
    Sun Nov 14 16:04:59 2004
@@ -11,10 +11,11 @@
      * @param html  The map of HTML Tag Renderers
      * @param xhtml The map of XHTML Tag Renderers
      */
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
-        html.put(AREA_TAG, new AreaTag.HtmlRendering());
-        xhtml.put(ANCHOR_TAG, new AreaTag.XhtmlRendering());
+        html.put(AREA_TAG, new HtmlRendering());
+        htmlQuirks.put(AREA_TAG, new HtmlRendering());
+        xhtml.put(AREA_TAG, new XhtmlRendering());
     }
 
     public void doStartTag(AbstractRenderAppender sb, AbstractTagState 
renderState)

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
    Sun Nov 14 16:04:59 2004
@@ -29,9 +29,10 @@
  */
 public abstract class BaseTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(BASE_TAG, new HtmlRendering());
+        htmlQuirks.put(BASE_TAG, new HtmlRendering());
         xhtml.put(BASE_TAG, new XhtmlRendering());
     }
 

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
    Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 public abstract class BodyTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(BODY_TAG, new Rendering());
+        htmlQuirks.put(BODY_TAG, new Rendering());
         xhtml.put(BODY_TAG, new Rendering());
     }
 

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
 Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class CaptionTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(CAPTION_TAG, new Rendering());
+        htmlQuirks.put(CAPTION_TAG, new Rendering());
         xhtml.put(CAPTION_TAG, new Rendering());
     }
 

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
     Sun Nov 14 16:04:59 2004
@@ -26,9 +26,10 @@
  */
 public abstract class DivTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(DIV_TAG, new Rendering());
+        htmlQuirks.put(DIV_TAG, new Rendering());
         xhtml.put(DIV_TAG, new Rendering());
     }
 

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
    Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class FormTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(FORM_TAG, new HtmlRendering());
+        htmlQuirks.put(FORM_TAG, new HtmlRendering());
         xhtml.put(FORM_TAG, new XhtmlRendering());
     }
 

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
    Sun Nov 14 16:04:59 2004
@@ -18,8 +18,6 @@
 package org.apache.beehive.netui.tags.rendering;
 
 import org.apache.beehive.netui.tags.html.HtmlConstants;
-
-import javax.servlet.jsp.PageContext;
 import java.util.HashMap;
 
 /**
@@ -28,9 +26,10 @@
  */
 abstract public class HtmlTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(HTML_TAG, new HtmlTag.HtmlRendering());
+        htmlQuirks.put(HTML_TAG, new HtmlTag.HtmlQuirksRendering());
         xhtml.put(HTML_TAG, new HtmlTag.XhtmlRendering());
     }
 
@@ -74,6 +73,18 @@
         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(AbstractRenderAppender sb, 
State renderState)
+        {
+        }
+    }
+
+    private static class HtmlQuirksRendering extends HtmlTag
+    {
+        protected void renderDocType(AbstractRenderAppender sb)
+        {
+            sb.append("<!DOCTYPE HTML PUBLIC \"//W3C//DTD HTML 4.01 
Transitional//EN\"\n>");
         }
 
         protected void renderAdditionalAttributes(AbstractRenderAppender sb, 
State renderState)

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
   Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
 abstract public class ImageTag extends TagHtmlBase implements HtmlConstants
 {
     // @todo: need to remove onmouseover and onmouseout
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(IMAGE_TAG, new HtmlRendering());
+        htmlQuirks.put(IMAGE_TAG, new HtmlRendering());
         xhtml.put(IMAGE_TAG, new XhtmlRendering());
     }
 

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
    Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 abstract public class InputBooleanTag extends TagHtmlBase implements 
HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_BOOLEAN_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_BOOLEAN_TAG, new HtmlRendering());
         xhtml.put(INPUT_BOOLEAN_TAG, new XhtmlRendering());
     }
 

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
       Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 abstract public class InputFileTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_FILE_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_FILE_TAG, new HtmlRendering());
         xhtml.put(INPUT_FILE_TAG, new XhtmlRendering());
     }
 

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
     Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 abstract public class InputHiddenTag extends TagHtmlBase implements 
HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_HIDDEN_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_HIDDEN_TAG, new HtmlRendering());
         xhtml.put(INPUT_HIDDEN_TAG, new XhtmlRendering());
     }
 

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
      Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 abstract public class InputImageTag extends TagHtmlBase implements 
HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_IMAGE_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_IMAGE_TAG, new HtmlRendering());
         xhtml.put(INPUT_IMAGE_TAG, new XhtmlRendering());
     }
 

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
     Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 abstract public class InputSubmitTag extends TagHtmlBase implements 
HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_SUBMIT_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_SUBMIT_TAG, new HtmlRendering());
         xhtml.put(INPUT_SUBMIT_TAG, new XhtmlRendering());
     }
 

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
       Sun Nov 14 16:04:59 2004
@@ -29,9 +29,10 @@
 abstract public class InputTextTag extends TagHtmlBase
         implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(INPUT_TEXT_TAG, new HtmlRendering());
+        htmlQuirks.put(INPUT_TEXT_TAG, new HtmlRendering());
         xhtml.put(INPUT_TEXT_TAG, new XhtmlRendering());
     }
 

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
   Sun Nov 14 16:04:59 2004
@@ -26,9 +26,10 @@
  */
 public abstract class LabelTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(LABEL_TAG, new Rendering());
+        htmlQuirks.put(LABEL_TAG, new Rendering());
         xhtml.put(LABEL_TAG, new Rendering());
     }
 

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
  Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 public abstract class OptionTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(OPTION_TAG, new HtmlRendering());
+        htmlQuirks.put(OPTION_TAG, new HtmlRendering());
         xhtml.put(OPTION_TAG, new XhtmlRendering());
     }
 

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
  Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 public abstract class SelectTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(SELECT_TAG, new HtmlRendering());
+        htmlQuirks.put(SELECT_TAG, new HtmlRendering());
         xhtml.put(SELECT_TAG, new XhtmlRendering());
     }
 

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
    Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class SpanTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(SPAN_TAG, new Rendering());
+        htmlQuirks.put(SPAN_TAG, new Rendering());
         xhtml.put(SPAN_TAG, new Rendering());
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/THeadTag.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/THeadTag.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/THeadTag.java
   Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
 public abstract class THeadTag
     extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(THEAD_TAG, new THeadTag.Rendering());
+        htmlQuirks.put(THEAD_TAG, new THeadTag.Rendering());
         xhtml.put(THEAD_TAG, new THeadTag.Rendering());
     }
 

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
   Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class TableTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(TABLE_TAG, new Rendering());
+        htmlQuirks.put(TABLE_TAG, new Rendering());
         xhtml.put(TABLE_TAG, new Rendering());
     }
 

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
   Sun Nov 14 16:04:59 2004
@@ -19,6 +19,8 @@
 
 import org.apache.beehive.netui.tags.html.Html;
 import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.util.config.ConfigUtil;
+import org.apache.beehive.netui.util.config.bean.JspTagConfig;
 import org.apache.beehive.netui.util.logging.Logger;
 import org.apache.struts.util.ResponseUtils;
 
@@ -50,9 +52,45 @@
      */
     public static final int XHTML_RENDERING = 2;
 
+    /**
+     * Identifier for HTML 4.01 Rendering in Quirks mode
+     */
+    public static final int HTML_RENDERING_QUIRKS = 3;
+
     //////////////////////////////////// Supported Rendering Constants  
////////////////////////////
 
     /**
+     * The static initializer will read the netui config file and set the doc 
type of there is
+     * one specified.
+     */
+
+    private static int _defaultDocType;
+
+    static {
+         _defaultDocType = HTML_RENDERING_QUIRKS;
+        JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
+        if (tagConfig != null) {
+            String docType = tagConfig.getDoctype();
+            setDefaultDocType(docType);
+        }
+    }
+
+    public static int getDefaultDocType() {
+        return _defaultDocType;
+    }
+
+    public static void setDefaultDocType(String docType) {
+        if (docType != null) {
+            if (docType.equals(Html.HTML_401))
+                _defaultDocType = TagRenderingBase.HTML_RENDERING;
+            else if (docType.equals(Html.HTML_401_QUIRKS))
+                _defaultDocType = TagRenderingBase.HTML_RENDERING_QUIRKS;
+            else if (docType.equals(Html.XHTML_10))
+                _defaultDocType = TagRenderingBase.XHTML_RENDERING;
+        }
+    }
+
+    /**
      * Token identifying the Anchor Renderer &lt;a>
      */
     public static final Object ANCHOR_TAG = new Object();
@@ -235,6 +273,7 @@
     {
         private static HashMap _xhtml;      // The XHTML TagRenderingBase 
objects
         private static HashMap _html;       // The HTML TagRenderingBase 
objects
+        private static HashMap _htmlQuirks; // THe HTML Quirks 
TagRenderingBase object
 
         private static ConstantRendering _xhtmlConstants;
         private static ConstantRendering _htmlConstants;
@@ -244,32 +283,34 @@
         {
             _xhtml = new HashMap(37);
             _html = new HashMap(37);
+            _htmlQuirks = new HashMap(37);
 
             // build the supported renderers.
-            AnchorTag.add(_html, _xhtml);
-            BaseTag.add(_html, _xhtml);
-            BodyTag.add(_html, _xhtml);
-            CaptionTag.add(_html, _xhtml);
-            DivTag.add(_html, _xhtml);
-            FormTag.add(_html, _xhtml);
-            ImageTag.add(_html, _xhtml);
-            InputBooleanTag.add(_html, _xhtml);
-            InputFileTag.add(_html, _xhtml);
-            InputHiddenTag.add(_html, _xhtml);
-            InputImageTag.add(_html, _xhtml);
-            InputSubmitTag.add(_html, _xhtml);
-            InputTextTag.add(_html, _xhtml);
-            HtmlTag.add(_html, _xhtml);
-            LabelTag.add(_html, _xhtml);
-            OptionTag.add(_html, _xhtml);
-            SelectTag.add(_html, _xhtml);
-            SpanTag.add(_html, _xhtml);
-            TableTag.add(_html, _xhtml);
-            TdTag.add(_html, _xhtml);
-            TextAreaTag.add(_html, _xhtml);
-            ThTag.add(_html, _xhtml);
-            THeadTag.add(_html, _xhtml);
-            TrTag.add(_html, _xhtml);
+            AnchorTag.add(_html, _htmlQuirks, _xhtml);
+            AreaTag.add(_html, _htmlQuirks, _xhtml);
+            BaseTag.add(_html, _htmlQuirks, _xhtml);
+            BodyTag.add(_html, _htmlQuirks, _xhtml);
+            CaptionTag.add(_html, _htmlQuirks, _xhtml);
+            DivTag.add(_html, _htmlQuirks, _xhtml);
+            FormTag.add(_html, _htmlQuirks, _xhtml);
+            ImageTag.add(_html, _htmlQuirks, _xhtml);
+            InputBooleanTag.add(_html, _htmlQuirks, _xhtml);
+            InputFileTag.add(_html, _htmlQuirks, _xhtml);
+            InputHiddenTag.add(_html, _htmlQuirks, _xhtml);
+            InputImageTag.add(_html, _htmlQuirks, _xhtml);
+            InputSubmitTag.add(_html, _htmlQuirks, _xhtml);
+            InputTextTag.add(_html, _htmlQuirks, _xhtml);
+            HtmlTag.add(_html, _htmlQuirks, _xhtml);
+            LabelTag.add(_html, _htmlQuirks, _xhtml);
+            OptionTag.add(_html, _htmlQuirks, _xhtml);
+            SelectTag.add(_html, _htmlQuirks, _xhtml);
+            SpanTag.add(_html, _htmlQuirks, _xhtml);
+            TableTag.add(_html, _htmlQuirks, _xhtml);
+            TdTag.add(_html, _htmlQuirks, _xhtml);
+            TextAreaTag.add(_html, _htmlQuirks, _xhtml);
+            ThTag.add(_html, _htmlQuirks, _xhtml);
+            THeadTag.add(_html, _htmlQuirks, _xhtml);
+            TrTag.add(_html, _htmlQuirks, _xhtml);
         }
 
         /**
@@ -283,13 +324,26 @@
             Html html = (Html) req.getAttribute(Html.HTML_TAG_ID);
 
             // the default is html 4.0
-            int renderingType = HTML_RENDERING;
+            int renderingType = _defaultDocType;
             if (html != null) {
                 renderingType = html.getTargetDocumentType();
             }
 
             // pick the map of renderers
-            HashMap h = (renderingType == HTML_RENDERING) ? _html : _xhtml;
+            HashMap h = null;
+            switch (renderingType) {
+            case HTML_RENDERING:
+                h = _html;
+                break;
+            case HTML_RENDERING_QUIRKS:
+                h = _htmlQuirks;
+                break;
+            case XHTML_RENDERING:
+                h = _xhtml;
+                break;
+            default:
+                assert(true) : "Didn't find the map for rendering type:" + 
renderingType;
+            }
 
             // return the renderer
             Object o = h.get(token);
@@ -311,11 +365,11 @@
             }
 
             // the default is html 4.0
-            int renderingType = HTML_RENDERING;
+            int renderingType = TagRenderingBase.getDefaultDocType();
             if (html != null) {
                 renderingType = html.getTargetDocumentType();
             }
-            return (renderingType == HTML_RENDERING) ? _htmlConstants : 
_xhtmlConstants;
+            return (renderingType == XHTML_RENDERING) ? _xhtmlConstants :  
_htmlConstants;
 
         }
     }
@@ -335,6 +389,6 @@
         }
 
         // pick the map of renderers
-        return (renderingType == HTML_RENDERING) ? "&" : "&amp;";
+        return (renderingType == XHTML_RENDERING) ?  "&amp;" : "&";
     }
 }

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
      Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class TdTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(TD_TAG, new Rendering());
+        htmlQuirks.put(TD_TAG, new Rendering());
         xhtml.put(TD_TAG, new Rendering());
     }
 

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
        Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
  */
 public abstract class TextAreaTag extends TagHtmlBase implements HtmlConstants
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(TEXT_AREA_TAG, new HtmlRendering());
+        htmlQuirks.put(TEXT_AREA_TAG, new HtmlRendering());
         xhtml.put(TEXT_AREA_TAG, new XhtmlRendering());
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ThTag.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ThTag.java
      (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/ThTag.java
      Sun Nov 14 16:04:59 2004
@@ -28,9 +28,10 @@
 public abstract class ThTag
     extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(TH_TAG, new Rendering());
+        htmlQuirks.put(TH_TAG, new Rendering());
         xhtml.put(TH_TAG, new Rendering());
     }
 

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
      Sun Nov 14 16:04:59 2004
@@ -27,9 +27,10 @@
  */
 public abstract class TrTag extends TagHtmlBase
 {
-    public static void add(HashMap html, HashMap xhtml)
+    public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
     {
         html.put(TR_TAG, new Rendering());
+        htmlQuirks.put(TR_TAG, new Rendering());
         xhtml.put(TR_TAG, new Rendering());
     }
 

Modified: incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
==============================================================================
--- incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd      
(original)
+++ incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd      Sun Nov 
14 16:04:59 2004
@@ -15,6 +15,7 @@
                 <xsd:element name="pageflow-handlers" 
type="netui:pageflow-handlers" minOccurs="0" maxOccurs="1"/>
                 <xsd:element name="pageflow-config" 
type="netui:pageflow-config" minOccurs="0" maxOccurs="1"/>
                 <xsd:element name="type-converters" 
type="netui:type-converters" minOccurs="0" maxOccurs="1"/>
+                <xsd:element name="jsp-tag-config" type="netui:jsp-tag-config" 
minOccurs="0" maxOccurs="1"/>
                 <xsd:element name="iterator-factories" 
type="netui:iterator-factories" minOccurs="0" maxOccurs="1"/>
             </xsd:sequence>
         </xsd:complexType>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
       (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/local-netui-config.xml
       Sun Nov 14 16:04:59 2004
@@ -51,6 +51,10 @@
         <multipart-handler>memory</multipart-handler>
     </pageflow-config>
 
+    <jsp-tag-config>
+       <doctype>html4-loose</doctype>
+    </jsp-tag-config>
+
     <iterator-factories>
     </iterator-factories>
 

Reply via email to