myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svieu...@apache.org
Subject cvs commit: incubator-myfaces/src/components/org/apache/myfaces/custom/buffer HtmlResponseWriterImpl.java
Date Mon, 31 Jan 2005 17:03:54 GMT
svieujot    2005/01/31 09:03:54

  Modified:    src/myfaces/org/apache/myfaces/renderkit/html
                        HtmlResponseWriterImpl.java
               src/components/org/apache/myfaces/custom/buffer
                        HtmlResponseWriterImpl.java
  Log:
  Resynchronize the HtmlResponseWriterImpl from the renderkit, and from the x:buffer component.
  
  Revision  Changes    Path
  1.35      +8 -2      incubator-myfaces/src/myfaces/org/apache/myfaces/renderkit/html/HtmlResponseWriterImpl.java
  
  Index: HtmlResponseWriterImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/myfaces/org/apache/myfaces/renderkit/html/HtmlResponseWriterImpl.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- HtmlResponseWriterImpl.java	29 Jan 2005 10:04:25 -0000	1.34
  +++ HtmlResponseWriterImpl.java	31 Jan 2005 17:03:54 -0000	1.35
  @@ -34,10 +34,16 @@
   import java.util.Set;
   
   /**
  + * When modifying this class, remember to do the same to
  + * org.apache.myfaces.custom.buffer
  + *
    * @author Manfred Geiler (latest modification by $Author$)
    * @author Anton Koinov
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.35  2005/01/31 17:03:54  svieujot
  + * Resynchronize the HtmlResponseWriterImpl from the renderkit, and from the x:buffer component.
  + *
    * Revision 1.34  2005/01/29 10:04:25  matzew
    * MYFACES-91 patch by Jason Hoo. Thanks
    *
  
  
  
  1.2       +25 -10    incubator-myfaces/src/components/org/apache/myfaces/custom/buffer/HtmlResponseWriterImpl.java
  
  Index: HtmlResponseWriterImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/buffer/HtmlResponseWriterImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HtmlResponseWriterImpl.java	4 Jan 2005 15:41:06 -0000	1.1
  +++ HtmlResponseWriterImpl.java	31 Jan 2005 17:03:54 -0000	1.2
  @@ -16,10 +16,12 @@
   package org.apache.myfaces.custom.buffer;
   
   import org.apache.myfaces.config.MyfacesConfig;
  -import org.apache.myfaces.renderkit.html.HTML;
   import org.apache.myfaces.renderkit.html.util.DummyFormResponseWriter;
   import org.apache.myfaces.renderkit.html.util.DummyFormUtils;
  +import org.apache.myfaces.renderkit.html.util.HTMLEncoder;
   import org.apache.myfaces.renderkit.html.util.JavascriptUtils;
  +import org.apache.myfaces.renderkit.html.util.UnicodeEncoder;
  +import org.apache.myfaces.renderkit.RendererUtils;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -38,6 +40,9 @@
    * @author Anton Koinov
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.2  2005/01/31 17:03:54  svieujot
  + * Resynchronize the HtmlResponseWriterImpl from the renderkit, and from the x:buffer component.
  + *
    * Revision 1.1  2005/01/04 15:41:06  svieujot
    * new x:buffer component.
    *
  @@ -58,9 +63,11 @@
       private String _contentType;
       private String _characterEncoding;
       private String _startElementName;
  +    private UIComponent _startElementUIComponent;
       private boolean _startTagOpen;
   
       private static final Set s_emptyHtmlElements = new HashSet();
  +
       static
       {
           s_emptyHtmlElements.add("area");
  @@ -161,6 +168,7 @@
           _writer.write('<');
           _writer.write(name);
           _startElementName = name;
  +        _startElementUIComponent = uiComponent;
           _startTagOpen = true;
       }
   
  @@ -196,7 +204,9 @@
                   !name.equals(_startElementName))
               {
                   if (log.isWarnEnabled())
  -                    log.warn("HTML nesting warning on closing " + name + ": element " +
_startElementName + " not explicitly closed");
  +                    log.warn("HTML nesting warning on closing " + name + ": element " +
_startElementName +
  +                            (_startElementUIComponent==null?"":(" rendered by component
: "+
  +                            RendererUtils.getPathToComponent(_startElementUIComponent)))+"
not explicitly closed");
               }
           }
   
  @@ -231,6 +241,7 @@
           }
   
           _startElementName = null;
  +        _startElementUIComponent = null;
       }
   
       public void writeAttribute(String name, Object value, String componentPropertyName)
throws IOException
  @@ -345,7 +356,7 @@
   
           if (isScriptOrStyle())
           {
  -            _writer.write(strValue);
  +            _writer.write(UnicodeEncoder.encode(strValue, false, false));
           }
           else
           {
  @@ -368,7 +379,8 @@
   
           if (isScriptOrStyle())
           {
  -            _writer.write(cbuf, off, len);
  +            String strValue = new String(cbuf, off, len);
  +            _writer.write(UnicodeEncoder.encode(strValue, false, false));
           }
           else if (isTextarea())
           {
  @@ -425,7 +437,8 @@
       public void write(char cbuf[], int off, int len) throws IOException
       {
           closeStartTagIfNecessary();
  -        _writer.write(cbuf, off, len);
  +        String strValue = new String(cbuf, off, len);
  +        _writer.write(UnicodeEncoder.encode(strValue, false, false));
       }
   
       public void write(int c) throws IOException
  @@ -437,7 +450,8 @@
       public void write(char cbuf[]) throws IOException
       {
           closeStartTagIfNecessary();
  -        _writer.write(cbuf);
  +        String strValue = new String(cbuf);
  +        _writer.write(UnicodeEncoder.encode(strValue, false, false));
       }
   
       public void write(String str) throws IOException
  @@ -447,14 +461,15 @@
           // in such case, do not call down the writer chain
           if (str.length() > 0)
           {
  -            _writer.write(str);
  +            _writer.write(UnicodeEncoder.encode(str, false, false));
           }
       }
   
       public void write(String str, int off, int len) throws IOException
       {
           closeStartTagIfNecessary();
  -        _writer.write(str, off, len);
  +        String strValue = str.substring(off, len);
  +        _writer.write(UnicodeEncoder.encode(strValue, false, false));
       }
   
       // DummyFormResponseWriter support
  
  
  

Mime
View raw message