Hi Mario,

On Fri, 2007-10-26 at 22:49 +0200, Mario Ivankovits wrote:
> Please find a patch regarding the "SSSS without output buffering" here [1].
> This feature is not configurable in any way other than the current setup
> for server side state saving. It just saves usable informations in
> ViewState which was not used yet beside to check if the request is a
> postback.
> 
> I have no PC during the next two days, but will commit this stuff (if no
> one complains) by Sunday evening or Monday.
> 
> [1] https://issues.apache.org/jira/browse/MYFACES-1753

I cannot get this patch to apply cleanly unfortunately. And it's
difficult to review the patch file directly as it has a lot of
whtespace-only changes. However I've spent some time looking at the
existing code and the general principle seems sound.

However I wonder whether it is possible to just get rid of the
StateMarkerAwareWriter completely.

There are now two phases to rendering for JSP: buildView then encodeAll.
As long as no component changes the tree during the encodeAll pass then
it seems to me that it is possible to just compute the serialized view
state at the start of the encodeAll phase [1] and write it out directly
when it is needed. This doesn't mean that components cannot dynamically
alter the tree - it just means that they must do it before encodeAll is
invoked, ie in a taghandler rather than in encodeBegin/encodeEnd.

There might be a couple of flaws in my reasoning though: can backing bean code 
invoked during render alter the tree state (eg insert data into the attributes 
map of a component).
Is it necessary to support this kind of thing by backing beans in *rendering* 
phase? (obviously, it is quite reasonable in invokeApplication etc). I think 
not. In this case, state writing would become a whole lot simpler.

[1] well, creating this state could be postponed until first needed, just in 
case a page is rendered without any form in it.

Regards,

Simon

Reply via email to