Hi Aleksei!
> 1. In the document renderer, look for documentHead and documentBody
> children of the document component.
> 2. document renderer overtakes rendering of the children.
> 3. We create a new ResponseWriter which writes into a buffer.
> 4. document renderer renders document body with the created writer
> (not the original one)
> 5. <html>
> 6. render documentHead
> 7. write what was rendered into the buffer.
> 8. </html>
Ok, give it a try :-)

You have to change the DocumentRenderer to return true in "public
boolean getRendersChildren()", then you should see its children in
encodeBegin.
Still, I see a limitation with this solution with the special form of
the document* tags when it uses the state="start|end" stuff.

e.g.
<t:document state="start" />
<t:documentHead>
</t:documentHead>
<t:documentBody state="start">

<t:documentBody state="end"/>
<t:document state="end" />

The reason for this special syntax is, that that way you can have both
blocks in differen jsp:includes like Header.jsp and Footer.jsp.
This syntax cant be supported by your AddResource implementation. I dont
want to say its required, we just should document it.
What you can try to support is:

<t:document>

<t:documentHead>
</t:documentHead>
<t:documentBody state="start">

<t:documentBody state="end"/>

</t:document>

The only difference to the "normal" syntax is, that you have to render
not only the documentBody but also all components in between, shouldn't
be that hard and would really help.


Once you finished your new AddResource implementation (and you are
willing to donate it) add it to a jira issue and maybe drop me a note
please ;-)


Ciao,
Mario

Reply via email to