[
https://issues.apache.org/jira/browse/MYFACES-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061946#comment-13061946
]
Martin Kočí commented on MYFACES-3198:
--------------------------------------
> From http://www.mail-archive.com/[email protected]/msg53700.html:
> -MYFACES-3198 Unify exception handling from render_response
> component.encodeAll: it has sense, but if there is an
> exception, how to warrant than the ajax response is well formed? what to do
> in that case? just log? how the client is
> notified? Is some operation done on the client side?. Too many unresolved
> questions. At first view the safest strategy is
> throw the exception, so the exception handler can catch it and notify the
> client. From the spec point of view, ajax is an
> all/none operation, so it could sense but that falls outside jsf spec.
> how to warrant than the ajax response is well formed ?
actual XML element is closed in finally, it will be well formed. Currently
first exception terminates the render phase, proposed change only modifies it
to catch and queue more than one exception.
> At first view the safest strategy is throw the exception, so the exception
> handler can catch it and notify the client
No, the main problem here is that this does not work: if exception occurs in
render response, there is no error handling on client: ajax response in
incomplete (but well formed) and send to client as <update> elements; no
<errror> element - only output here is in log.
I propose following:
1) publish exception in render response (this consolidates exception handling
with other lifecycle phases; also it is useful for development - consider two
or more buggy getters - user can see all exceptions at once and solve them at
once, not only the first one (followed with redeploy)
2) improve default exception handler for partial: if exception handler
processes one or more exception from render response phase and if it is
partial, it must perform ajax redirect to error page - this needs MYFACES-3191.
> Unify exception handling from render_response component.encodeAll
> -----------------------------------------------------------------
>
> Key: MYFACES-3198
> URL: https://issues.apache.org/jira/browse/MYFACES-3198
> Project: MyFaces Core
> Issue Type: Sub-task
> Components: General
> Environment: myfaces core trunk
> Reporter: Martin Kočí
>
> Myfaces
> PartialViewContextImpl.PhaseAwareVisitCallback.processRenderComponent(UIComponent)
> catches only IOExpcetion and nothing else.
> I've checked Mojarra and RichFaces (they have own PartialViewContextImpl) and
> both those implementations catch all exception; that isolates rendering of a
> component (and it children) - in case of exception, rest of component tree
> can still be rendered.
> Similar concept of isolating execution for one component can be seen in
> UIInput.updateModel - problem in one component does not have influence on
> other components in tree. Maybe we should check all code for this symmetry.
> previous is valid for partial lifecycle. For full lifecycle, rendering begins
> with UIViewRoot.encodeAll .
> Also catched exception should not be logged, but queued with
> ExceptionQueuedEvent.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira