You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2001/04/29 07:59:59 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/template GetTag.java

craigmcc    01/04/28 22:59:59

  Modified:    doc      struts-template.xml
               src/share/org/apache/struts/taglib/template GetTag.java
  Log:
  Add an optional "flush" attribute that, if set to true, will cause the
  response to be flushed before the content specified by this <template:get>
  tag is included.  This allows working around problems on broken servlet
  containers (such as WebSphere in this particular case).
  
  PR: Bugzilla #760
  Submitted by:	nathann@objectfx.com, dmiser@wi.rr.com
  
  Revision  Changes    Path
  1.2       +13 -0     jakarta-struts/doc/struts-template.xml
  
  Index: struts-template.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/struts-template.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- struts-template.xml	2001/03/18 17:48:58	1.1
  +++ struts-template.xml	2001/04/29 05:59:58	1.2
  @@ -120,6 +120,19 @@
       </info>
   
       <attribute>
  +      <name>flush</name>
  +      <required>false</required>
  +      <rtexprvalue>true</rtexprvalue>
  +      <info>
  +      If set to <code>true</code>, flush the response buffer prior to
  +      including the content specified by the <code>name</code> attribute.
  +      By default, the response is not flushed.  <strong>NOTE</strong> -
  +      this attribute exists only to work around problems on some containers;
  +      flushing should never be required.
  +      </info>
  +    </attribute>
  +
  +    <attribute>
         <name>name</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
  
  
  
  1.10      +33 -4     jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java
  
  Index: GetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- GetTag.java	2001/04/29 05:34:49	1.9
  +++ GetTag.java	2001/04/29 05:59:58	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.9 2001/04/29 05:34:49 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/04/29 05:34:49 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.10 2001/04/29 05:59:58 craigmcc Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/04/29 05:59:58 $
    *
    * ====================================================================
    *
  @@ -75,7 +75,7 @@
    * it, depending upon the value of the content's direct attribute.
    *
    * @author David Geary
  - * @version $Revision: 1.9 $ $Date: 2001/04/29 05:34:49 $
  + * @version $Revision: 1.10 $ $Date: 2001/04/29 05:59:58 $
    */
   public class GetTag extends TagSupport {
   
  @@ -83,6 +83,12 @@
   
   
      /**
  +    * Should we flush before including this text?
  +    */
  +    private boolean flush = false;
  +
  +
  +   /**
        * The name of the content that this tag includes (or prints).
        */
      private String name;
  @@ -93,6 +99,16 @@
      private String role;
   
      /**
  +    * Set the flush-before-include property
  +    * @param flush The new flush property
  +    */
  +   public void setFlush(boolean flush) {
  +
  +      this.flush = flush;
  +
  +   }
  +
  +   /**
        * Set the name attribute
        * @param name The name of the content to get.
        */
  @@ -113,6 +129,16 @@
      }
   
      /**
  +    * Get the flush-before-include attribute.
  +    */
  +   public boolean getFlush() {
  +
  +      return flush;
  +
  +   }
  +
  +
  +   /**
        * Get the name attribute.
        */
      public String getName() { 
  @@ -158,6 +184,8 @@
            }
            else {
               try {
  +               if (flush)
  +                  pageContext.getOut().flush();
                  pageContext.include(content.toString());
               }
               catch(Exception ex) { 
  @@ -179,6 +207,7 @@
   
         super.release();
         name = role = null;
  +      flush = false;
   
      }