[jboss-cvs] jboss-seam/src/mail/org/jboss/seam/mail/ui ...

Peter Muir peter at bleepbleep.org.uk
Thu Apr 5 12:33:40 EDT 2007


  User: pmuir   
  Date: 07/04/05 12:33:40

  Modified:    src/mail/org/jboss/seam/mail/ui  MailComponent.java
  Log:
  JBSEAM-1149
  
  Revision  Changes    Path
  1.8       +21 -7     jboss-seam/src/mail/org/jboss/seam/mail/ui/MailComponent.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MailComponent.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/mail/org/jboss/seam/mail/ui/MailComponent.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- MailComponent.java	5 Apr 2007 15:08:26 -0000	1.7
  +++ MailComponent.java	5 Apr 2007 16:33:40 -0000	1.8
  @@ -41,30 +41,44 @@
   
      protected String encode(FacesContext facesContext) throws IOException
      {
  -      return encode(facesContext, this);
  +      return encode(facesContext, this, null, false);
      }
      
      protected String encode(FacesContext facesContext, UIComponent cmp) throws IOException
      {
  -      return encode(facesContext, cmp, null);
  +      return encode(facesContext, cmp, null, true);
      }
      
      protected String encode(FacesContext facesContext, String contentType) throws IOException
      {
  -      return encode(facesContext, this, contentType);
  +      return encode(facesContext, this, contentType, false);
  +   }
  +   
  +   protected String encode(FacesContext facesContext, UIComponent cmp, String contentType) throws IOException
  +   {
  +      return encode(facesContext, cmp, contentType, true);
      }
   
      /**
       * Encode the children of cmp, writing to a string (rather than the http
       * response object) and return the string
       */
  -   protected String encode(FacesContext facesContext, UIComponent cmp, String contentType) throws IOException
  +   protected String encode(FacesContext facesContext, UIComponent cmp, String contentType, boolean root)
  +            throws IOException
      {
         ResponseWriter response = facesContext.getResponseWriter();
         StringWriter stringWriter = new StringWriter();
  -      ResponseWriter cachingResponseWriter = ((MailResponseWriter) response).cloneWithWriter(stringWriter, contentType);
  +      ResponseWriter cachingResponseWriter = ((MailResponseWriter) response).cloneWithWriter(
  +               stringWriter, contentType);
         facesContext.setResponseWriter(cachingResponseWriter);
  +      if (root)
  +      {
  +         JSF.renderChild(facesContext, cmp);
  +      }
  +      else
  +      {
         JSF.renderChildren(facesContext, cmp);
  +      }
         facesContext.setResponseWriter(response);
         String output = stringWriter.getBuffer().toString();
         return output;
  
  
  



More information about the jboss-cvs-commits mailing list