commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Keese" <bi...@tech.beacon-it.co.jp>
Subject [jelly] threads & xmlOutput
Date Thu, 22 May 2003 05:34:52 GMT
By default, the <thread> tag creates it's own XMLOutput object, writing to
System.out, rather than using the caller's XMLOutput object.  (The XMLOutput
argument to doTag() is ignored.)  I think the default should be to use the
caller's XMLOutput object.

For example, the following program has two XMLOutput objects, both writing
to System.out, but due to buffering inside the XMLOutput class, the output
gets garbled:

Code:
  <hello>
      <threads:thread var="myThread">
           <world/>
      </threads:thread>
       <threads:join thread="${myThread}"/>
   </hello>

Output:
   <world><world/><hello></hello>

Output I want:
  <hello>
      <world></world>
  </hello>

Of course, anytime you have multiple objects writing to the same xmlOutput
stream, you need to be careful, and do synchronization, in order to make
sure that you produce a valid XML document.

Comments?

Also, is there any way to get access to the current xmlOutput stream?  Then
I could workaround by doing something like
     <threads:thread var="myThread" xmlOutput="${getCurrentXMLOutput()}">

But I can't find a function like that.

Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message