Antonio, 

First of all, I'm not saying you are wrong about XSLT closing the result
stream -- I don't have enough knowledge to comment on that problem,
however...

Here's what I did to test this.  I copied the source for XSLTResult to a
new class, and added a boolean parameter to the result called flush.  In
my struts.xml file, I set the parameter to false (or let it default) and
put an if statement around the out.close() method in XSLTResult.execute,
line 357.
So the code looks like this:

            if( getFlush() ){
                LOG.debug("Flushing output stream");
                out.close(); // ...and flush...
            }

Sure enough, if the flag is true, the stream is closed and the exception
occurs. If the flag is false, and the close() gets stepped over, the
stream is left open and the remainder of the tiles render.

The XSLTResult class isn't really well structured to act as a
superclass, so unfortunately, in order to get this to work I have to
copy the class to a new class and add this implementation.  

I would argue this is a bug in XSLTResult.

Thanks for your comments and support.

MG

-----Original Message-----
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 11, 2008 8:31 AM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

2008/3/11, Griffith, Michael * <[EMAIL PROTECTED]>:
>
> Would you then agree this is a bug or enhancement that could be made
to
> the XSLTResult? Maybe a flush parameter could be added to the
> configuration of the result?


I don't think it is a bug of XSLTResult, since it "closes" (not simply
"flushes") the stream. The fact that the parser closes the stream is in
the
XML specification (yeah, this is *stupid* but they did it).
Anyway probably XSLTResult needs a workaround for this
<sarcasm>feature</sarcasm> since we cannot change the specifications.

Antonio

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

Reply via email to