dgraham     2002/11/15 22:05:22

  Modified:    src/share/org/apache/struts/taglib/html ImageTag.java
                        SubmitTag.java CancelTag.java
                        JavascriptValidatorTag.java CheckboxTag.java
                        FrameTag.java BaseFieldTag.java ResetTag.java
                        FormTag.java ButtonTag.java ImgTag.java
                        RadioTag.java HtmlTag.java BaseTag.java
                        MultiboxTag.java
  Log:
  Updated xhtml implementation to work with jsp includes.
  
  Revision  Changes    Path
  1.25      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java
  
  Index: ImageTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ImageTag.java     12 Nov 2002 03:47:42 -0000      1.24
  +++ ImageTag.java     16 Nov 2002 06:05:21 -0000      1.25
  @@ -261,7 +261,7 @@
           }
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Render this element to our writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.16      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/SubmitTag.java
  
  Index: SubmitTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/SubmitTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SubmitTag.java    12 Nov 2002 03:47:42 -0000      1.15
  +++ SubmitTag.java    16 Nov 2002 06:05:21 -0000      1.16
  @@ -230,7 +230,7 @@
           results.append("\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Render this element to our writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.10      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/CancelTag.java
  
  Index: CancelTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/CancelTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CancelTag.java    12 Nov 2002 03:47:42 -0000      1.9
  +++ CancelTag.java    16 Nov 2002 06:05:21 -0000      1.10
  @@ -210,7 +210,7 @@
           results.append("\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Render this element to our writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.16      +5 -2      
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JavascriptValidatorTag.java       12 Nov 2002 05:59:24 -0000      1.15
  +++ JavascriptValidatorTag.java       16 Nov 2002 06:05:21 -0000      1.16
  @@ -632,7 +632,10 @@
           StringBuffer start = new StringBuffer("<script type=\"text/javascript\"");
   
           // there is no language attribute in xhtml
  -        if (!BaseHandlerTag.isXhtml(this)) {
  +        String xhtml =
  +            (String) this.pageContext.getAttribute(Globals.XHTML_KEY, 
this.pageContext.PAGE_SCOPE);
  +        
  +        if (!("true".equalsIgnoreCase(xhtml))) {
               start.append(" language=\"Javascript1.1\"");
           }
   
  
  
  
  1.17      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java
  
  Index: CheckboxTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CheckboxTag.java  12 Nov 2002 03:47:42 -0000      1.16
  +++ CheckboxTag.java  16 Nov 2002 06:05:21 -0000      1.17
  @@ -218,7 +218,7 @@
               results.append(" checked=\"checked\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Print this field to our output writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.8       +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/FrameTag.java
  
  Index: FrameTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FrameTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FrameTag.java     13 Nov 2002 06:10:54 -0000      1.7
  +++ FrameTag.java     16 Nov 2002 06:05:21 -0000      1.8
  @@ -243,7 +243,7 @@
               results.append("\"");
           }
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
           ResponseUtils.write(pageContext,results.toString());
   
       // Skip the body of this tag
  
  
  
  1.17      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java
  
  Index: BaseFieldTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- BaseFieldTag.java 12 Nov 2002 03:47:42 -0000      1.16
  +++ BaseFieldTag.java 16 Nov 2002 06:05:21 -0000      1.17
  @@ -181,7 +181,7 @@
           results.append("\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Print this field to our output writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.11      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/ResetTag.java
  
  Index: ResetTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ResetTag.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ResetTag.java     12 Nov 2002 03:47:42 -0000      1.10
  +++ ResetTag.java     16 Nov 2002 06:05:21 -0000      1.11
  @@ -225,7 +225,7 @@
        results.append("\"");
        results.append(prepareEventHandlers());
        results.append(prepareStyles());
  -     results.append(getElementClose(this));
  +     results.append(getElementClose());
   
        // Render this element to our writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.34      +8 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
  
  Index: FormTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- FormTag.java      12 Nov 2002 06:08:33 -0000      1.33
  +++ FormTag.java      16 Nov 2002 06:05:21 -0000      1.34
  @@ -833,7 +833,10 @@
        */
       private String getJsStartElement() {
           String start = "<script type=\"text/javascript\"";
  -        if (!BaseHandlerTag.isXhtml(this)) {
  +        String xhtml =
  +            (String) this.pageContext.getAttribute(Globals.XHTML_KEY, 
this.pageContext.PAGE_SCOPE);
  +
  +        if (!("true".equalsIgnoreCase(xhtml))) {
               start += " language=\"JavaScript\"";
           }
           start += ">\r\n";
  
  
  
  1.14      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java
  
  Index: ButtonTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ButtonTag.java    12 Nov 2002 03:47:42 -0000      1.13
  +++ ButtonTag.java    16 Nov 2002 06:05:21 -0000      1.14
  @@ -207,7 +207,7 @@
           results.append("\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Render this element to our writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.24      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java
  
  Index: ImgTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ImgTag.java       13 Nov 2002 06:10:54 -0000      1.23
  +++ ImgTag.java       16 Nov 2002 06:05:21 -0000      1.24
  @@ -465,7 +465,7 @@
           }
           results.append(prepareStyles());
           results.append(prepareEventHandlers());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Print this element to our output writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.18      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/RadioTag.java
  
  Index: RadioTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/RadioTag.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- RadioTag.java     12 Nov 2002 03:47:42 -0000      1.17
  +++ RadioTag.java     16 Nov 2002 06:05:21 -0000      1.18
  @@ -284,7 +284,7 @@
               results.append(" checked=\"checked\"");
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Print this field to our output writer
           ResponseUtils.write(pageContext, results.toString());
  
  
  
  1.7       +11 -7     
jakarta-struts/src/share/org/apache/struts/taglib/html/HtmlTag.java
  
  Index: HtmlTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/HtmlTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HtmlTag.java      12 Nov 2002 03:47:42 -0000      1.6
  +++ HtmlTag.java      16 Nov 2002 06:05:21 -0000      1.7
  @@ -132,7 +132,6 @@
        * @exception JspException if a JSP exception has occurred
        */
       public int doStartTag() throws JspException {
  -
           StringBuffer sb = new StringBuffer("<html");
   
           // Use the current Locale to set our language preferences
  @@ -143,7 +142,13 @@
                   sb.append(" lang=\"");
                   sb.append(lang);
                   sb.append("\"");
  -                if (xhtml) {
  +                
  +                if (this.xhtml) {
  +                    this.pageContext.setAttribute(
  +                        Globals.XHTML_KEY,
  +                        "true",
  +                        this.pageContext.PAGE_SCOPE);
  +                        
                       sb.append(" xml:lang=\"");
                       sb.append(lang);
                       sb.append("\"");
  @@ -158,7 +163,6 @@
   
           // Evaluate the included content of this tag
           return (EVAL_BODY_INCLUDE);
  -
       }
   
   
  
  
  
  1.10      +9 -6      
jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java
  
  Index: BaseTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BaseTag.java      12 Nov 2002 03:47:42 -0000      1.9
  +++ BaseTag.java      16 Nov 2002 06:05:22 -0000      1.10
  @@ -132,8 +132,11 @@
               buf.append("\"");
           }
   
  -        if (BaseHandlerTag.isXhtml(this)) {
  -            buf.append("/>");
  +        String xhtml =
  +            (String) this.pageContext.getAttribute(Globals.XHTML_KEY, 
this.pageContext.PAGE_SCOPE);
  +        
  +        if ("true".equalsIgnoreCase(xhtml)) {
  +            buf.append(" />");
           } else {
               buf.append(">");
           }
  
  
  
  1.17      +5 -5      
jakarta-struts/src/share/org/apache/struts/taglib/html/MultiboxTag.java
  
  Index: MultiboxTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/MultiboxTag.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- MultiboxTag.java  12 Nov 2002 03:47:42 -0000      1.16
  +++ MultiboxTag.java  16 Nov 2002 06:05:22 -0000      1.17
  @@ -253,7 +253,7 @@
           }
           results.append(prepareEventHandlers());
           results.append(prepareStyles());
  -        results.append(getElementClose(this));
  +        results.append(getElementClose());
   
           // Render this element to our response
           ResponseUtils.write(pageContext, results.toString());
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to