From: Lane S. <la...@op...> - 2004-03-13 23:11:41
|
Tim, Eric, Keats: The problem, as presented by Keats, is that in 2.0, WM renders a template to a backing store using a FastWriter impl instance, not to the outputstream. I kinda knew this to be the case but could not verify it. Therefore, prior to 2.0, Melati exploited its knowledge of the behavior of FW. With 2.0, this knowledge of the WM implementation is no longer correct. WM writes to a backing store in 2.0, not directly to the output stream. The FastWriter instance used internally to write out a template is not visible to the template in 2.0. In 2.0, you write to an output stream or to a string. In 2.0, as has been noted, the reference to the FW instance used to render the template internally is not available. Personally, I think it is bad form that melati exploited internal knowledge of the FW mechanics. This broke the encapsulation contract and now melati is broken. The melati template variable, $ml, instead of returning strings for method calls, has an internal operation which writes to the output stream. Since the template is buffered, this write op ends up at the front of the output. My suggestion at this point is to back out the exploited knowledge. $ml, a context variable and object, should return renderable text, not attempt to write to the output stream. This would decouple it from internal knowledge of the templating frameworks and standardize its behavior in a normal manner for all template engines, not just WM. -Lane Tim Pizey wrote: >On Saturday 13 March 2004 7:54 am, Lane Sharman wrote: > > >>Eric, >> >>Would you please do an update, look at the above class file and run it. >>Tell me I am not going crazy. Do not answer that :) >> >>For the life of me, I cannot understand why this is a failure!!! How did >>Melati run in 1.1 and now not run in 2.0??? >> >>The test case shows the obvious. If you have a reference inside a >>template that writes to the output stream. And, if the reference >>internally flushes to the stream as it needs to, how can it NOT be at >>the beginning of the destination output stream. How could it work in 1.1? >> >>In any case, I have gone as far as I can/want to go with this Melati >>failure in 2.0 without a second opinion. >> >> > >Lane, >you have my sympathies, I hit the same snags. > >I hope that TimJ may be able to help?? > >cheers >Tim P > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click >_______________________________________________ >Melati-developers mailing list >Mel...@li... >https://lists.sourceforge.net/lists/listinfo/melati-developers > > > -- Lane Sharman For Protection from SPAM and Virus, Extend to the Network Your Perimeter of Defense: http://www.opendoors.com 858-755-2868 |