You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by janw <ja...@gmx.de> on 2006/10/05 14:46:57 UTC
Render Response phase is skipped
Hello,
how can it be that for some pages the RENDER_RESPONSE Phase is skipped?
I use a PhaseTracker which dumps every phase that is run through, and there
are JSPs which are correctly rendered, but for which the phase is not
traversed.
Jan
--
View this message in context: http://www.nabble.com/Render-Response-phase-is-skipped-tf2388227.html#a6657860
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Render Response phase is skipped
Posted by janw <ja...@gmx.de>.
After your responses I thought the mistake must be on my side.
And I found the reason:
I used another PhaseListener (let it be listener_1), one that works like the
one from Cagatay
(http://www.jroller.com/page/cagataycivici?entry=managed_beans_aware_of_the).
But I defined PhaseID = RENDER_RESPONSE (it didn't work for me with
Restore_View).
So the mistake was in beforePhase() of listener_1.
The variable "managedBeanName" might be empty in my case.
When then calling createValueBinding("${}"), an exception was thrown (and
not caught).
I don't know why beforePhase() then is not called for further listeners, but
now I know the reason and could solve it.
Thanks for the hints.
Jan
public void beforePhase(PhaseEvent phaseEvent) {
String viewId = phaseEvent.getFacesContext().getViewRoot().getViewId();
if (viewId.endsWith(".jsf") || viewId.endsWith(".jsp")) {
String managedBeanName = getManagedBeanNameFromView(viewId);
// --- The next line could throw the exception ---
Object object = facesContext.getApplication().createValueBinding("#{"
+ managedBeanName + "}").getValue(facesContext);
if (object == null){
logger.error("OnPageLoad cannot be executed, no such managed bean:"+
managedBeanName);
}
else {
...
}
}
--
View this message in context: http://www.nabble.com/Render-Response-phase-is-skipped-tf2388227.html#a6662527
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Render Response phase is skipped
Posted by Martin Marinschek <ma...@gmail.com>.
Hi Jan,
I wouldn't know of anything in MyFaces which would render a response
to the user, but not traverse the RENDER_RESPONSE phase in some means
- only exception that would come to my mind are special
phase-listeners.
regards,
Martin
On 10/5/06, Simon Lessard <si...@gmail.com> wrote:
> Hello,
>
> This happen is FacesContext.responseComplete is called during another phase
> of the lifecycle. That method can be called for various reasons, like a
> redirection occuring in another phase for example.
>
>
> Regards,
>
> ~ Simon
>
>
> On 10/5/06, janw <ja...@gmx.de> wrote:
> >
> > Hello,
> >
> > how can it be that for some pages the RENDER_RESPONSE Phase is skipped?
> > I use a PhaseTracker which dumps every phase that is run through, and
> there
> > are JSPs which are correctly rendered, but for which the phase is not
> > traversed.
> >
> > Jan
> > --
> > View this message in context:
> http://www.nabble.com/Render-Response-phase-is-skipped-tf2388227.html#a6657860
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
>
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
Re: Render Response phase is skipped
Posted by Simon Lessard <si...@gmail.com>.
Hello,
This happen is FacesContext.responseComplete is called during another phase
of the lifecycle. That method can be called for various reasons, like a
redirection occuring in another phase for example.
Regards,
~ Simon
On 10/5/06, janw <ja...@gmx.de> wrote:
>
>
> Hello,
>
> how can it be that for some pages the RENDER_RESPONSE Phase is skipped?
> I use a PhaseTracker which dumps every phase that is run through, and
> there
> are JSPs which are correctly rendered, but for which the phase is not
> traversed.
>
> Jan
> --
> View this message in context:
> http://www.nabble.com/Render-Response-phase-is-skipped-tf2388227.html#a6657860
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>