Tiles
  1. Tiles
  2. TILES-500

"flush" attribute is not evaluated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.2.1
    • Fix Version/s: 2.2.2
    • Labels:
      None

      Description

      The "flush" attribute is not evaluated at all. It is never used in any of the tags that define it.

      1. TILES-500.patch
        5 kB
        Mck SembWever

        Issue Links

          Activity

          Hide
          Greg Reddin added a comment -

          @Antonio, no it was way older than that. The issue is probably somewhere in the Struts project. The reporter posted a small webapp that had a crazy recursive tile insert thing going on IIRC.

          Show
          Greg Reddin added a comment - @Antonio, no it was way older than that. The issue is probably somewhere in the Struts project. The reporter posted a small webapp that had a crazy recursive tile insert thing going on IIRC.
          Antonio Petrelli made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Antonio Petrelli made changes -
          Original Estimate 0h [ 0 ]
          Remaining Estimate 0h [ 0 ]
          Assignee Antonio Petrelli [ brenmcguire ]
          Hide
          Antonio Petrelli added a comment -

          Applied patch by Mck SembWever.
          Thanks Mck!

          Fixed some JSP docs, and added the flush attribute in <tiles:getAsString>

          Show
          Antonio Petrelli added a comment - Applied patch by Mck SembWever. Thanks Mck! Fixed some JSP docs, and added the flush attribute in <tiles:getAsString>
          Hide
          Antonio Petrelli added a comment -

          Do you mean TILES-192? It's already connected as a referenced issue.

          Show
          Antonio Petrelli added a comment - Do you mean TILES-192 ? It's already connected as a referenced issue.
          Hide
          Greg Reddin added a comment -

          I'm sorry I don't remember the specifics, but I remember helping someone with a specific bug in Struts-Tiles a long time ago where this was an issue. Seems like I was helping with a ticket where somebody was trying to insert a bunch of nested tiles and the flush (or lack of flush) was causing them to render in the wrong order or something. I'll see if there's any chance I can find the ticket.

          Show
          Greg Reddin added a comment - I'm sorry I don't remember the specifics, but I remember helping someone with a specific bug in Struts-Tiles a long time ago where this was an issue. Seems like I was helping with a ticket where somebody was trying to insert a bunch of nested tiles and the flush (or lack of flush) was causing them to render in the wrong order or something. I'll see if there's any chance I can find the ticket.
          Hide
          Mck SembWever added a comment -

          > I don't know why, I don't think it is useful at all, why should one flush before something is inserted?

          It doesn't make sense to me either.
          You have no idea what currently is in the buffer, but

          • you would want to flush what about to be inserted,
          • you would want to know you're left with an empty buffer.
          Show
          Mck SembWever added a comment - > I don't know why, I don't think it is useful at all, why should one flush before something is inserted? It doesn't make sense to me either. You have no idea what currently is in the buffer, but you would want to flush what about to be inserted, you would want to know you're left with an empty buffer.
          Hide
          Antonio Petrelli added a comment -

          Ok that's fantastic :-D
          Curious as I am, I've taken a look at how Tiles 1 worked:
          http://svn.eu.apache.org/repos/asf/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/taglib/InsertTag.java

          In fact in Tiles 1 the flush is used to flush before the item is inserted. I don't know why, I don't think it is useful at all, why should one flush before something is inserted?
          However, I think that your final patch is OK, I will apply it ASAP. Thank you!

          Show
          Antonio Petrelli added a comment - Ok that's fantastic :-D Curious as I am, I've taken a look at how Tiles 1 worked: http://svn.eu.apache.org/repos/asf/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/taglib/InsertTag.java In fact in Tiles 1 the flush is used to flush before the item is inserted. I don't know why, I don't think it is useful at all, why should one flush before something is inserted? However, I think that your final patch is OK, I will apply it ASAP. Thank you!
          Mck SembWever made changes -
          Attachment TILES-500.patch [ 12439970 ]
          Mck SembWever made changes -
          Attachment TILES-500.patch [ 12440272 ]
          Hide
          Mck SembWever added a comment -

          sure thing. flush after insertion, and documentation accordingly.

          Show
          Mck SembWever added a comment - sure thing. flush after insertion, and documentation accordingly.
          Hide
          Antonio Petrelli added a comment -

          Sometimes I have to read the documentation... :-D
          You're right, but also the documentation is wrong, I don't know what I was thinking at the time :-D
          See how it worked in Tiles 2.1.x:
          http://tiles.apache.org/2.1/framework/tiles-jsp/xref/org/apache/tiles/jsp/taglib/RenderTag.html#218
          Can you patch the documentation too, please?

          Show
          Antonio Petrelli added a comment - Sometimes I have to read the documentation... :-D You're right, but also the documentation is wrong, I don't know what I was thinking at the time :-D See how it worked in Tiles 2.1.x: http://tiles.apache.org/2.1/framework/tiles-jsp/xref/org/apache/tiles/jsp/taglib/RenderTag.html#218 Can you patch the documentation too, please?
          Hide
          Mck SembWever added a comment -

          i only followed the documentation which says :
          ... If <code>true</code>, current page out stream is flushed before insertion.

          Show
          Mck SembWever added a comment - i only followed the documentation which says : ... If <code>true</code>, current page out stream is flushed before insertion.
          Hide
          Antonio Petrelli added a comment -

          Sorry, I did not notice that you flush the buffer before rendering.
          The flush must be done after calling "end" methods.

          Show
          Antonio Petrelli added a comment - Sorry, I did not notice that you flush the buffer before rendering. The flush must be done after calling "end" methods.
          Hide
          Antonio Petrelli added a comment -

          The patch is perfect, thanks! I will apply it ASAP.

          Show
          Antonio Petrelli added a comment - The patch is perfect, thanks! I will apply it ASAP.
          Mck SembWever made changes -
          Attachment TILES-500.patch [ 12439970 ]
          Hide
          Mck SembWever added a comment -

          Not entirely understanding what the desired fix here.

          But this patch makes flush="true" work as each Tag documents it to.
          That is with flush="true" the following code
          jspContext.getOut().flush()
          is called before any of the Tags do anything.

          Show
          Mck SembWever added a comment - Not entirely understanding what the desired fix here. But this patch makes flush="true" work as each Tag documents it to. That is with flush="true" the following code jspContext.getOut().flush() is called before any of the Tags do anything.
          Antonio Petrelli made changes -
          Field Original Value New Value
          Link This issue is related to TILES-192 [ TILES-192 ]
          Antonio Petrelli created issue -

            People

            • Assignee:
              Antonio Petrelli
              Reporter:
              Antonio Petrelli
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development