Yes, unfortunately org.apache.myfaces.ERROR_HANDLER is a myFaces thing
not a JSF speced behavior. It is implemented with the MyFaces
FacesServlet. As such its not in the picture when a portlet request is
being processed. And because its a MyFaces specific thing the bridge
doesn't support it. Hence why it works for you in a servlet environment
and not a portlet environment. So, yes you are on the right track in
terms of adding a ViewHandler that overrides and/or replaces a Portlet
specific FaceletViewHandler. I would use the I include in the examples
distribution from the Bridge (look at the sources for the facelets-guess
example -- it includes a PortletFaceletViewHandler.java. In your impl
of handleRenderException do the work you want to accomplish -- though
remember the portlet model doesn't support a redirect during a render --
the bridge does however recognize render redirects to other Faces views
as merely a request to rerun the render lifecycle on the new view. I.e.
its not a client redirect it more like a terminate/throw away my current
work and navigate/render in process this new view.
-Mike-
On 3/7/2011 11:21 PM, Yves Deschamps wrote:
Hi Michael,
The goal is to simulate an exception, intercept it and make somethings
like e-mail to application administrator, an exception page, etc...
Since my last e-mail, I progressed.
I use that:
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
and that..
<context-param>
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
<param-value>org.esupportail.blank.web.jsf.mixed.FaceletRedirectionViewHandler</param-value>
</context-param>
This last class extends com.sun.facelets.FaceletViewHandler, but the
result is not convincing...
Is it better to use com.sun.facelets.FaceletPortletViewHandler ?
Le 07/03/2011 22:44, Michael Freedman a écrit :
No idea -- as this is an error rendering a resource accessed via http
(i.e. not through the portlet -- but as a consequence of rendering a
portlet). Obviously there is an issue with the preferencesController
managed bean. What scope is it at? Can you set a breakpoint in
geet/set localeItems and try and see what is happening? Can you also
send the whole stack so we can see if there is any useful information
in it?
-Mike-
On 3/3/2011 7:40 AM, Yves Deschamps wrote:
Hi Scott
Trinidad 1.2.14 and portlet-bridge 1.0.0 (JSR 168)...
Le 03/03/2011 16:32, Scott O'Bryan a écrit :
Trinidad 1.2 and the latest Portlet Bridge 2.0 I assume?
On Mar 3, 2011, at 8:29 AM, Yves Deschamps
<[email protected]> wrote:
Hi,
I try to use org.apache.myfaces.ERROR_HANDLER with apache
porlet-bridge and my own error handling class .
But that does not work.
It is ok in servlet mode.
In portlet mode, the exception is handled like this...
3 mars 2011 16:16:14 com.sun.facelets.FaceletViewHandler
handleRenderException
GRAVE: Error Rendering View[/stylesheets/desktop/preferences.xhtml]
javax.el.ELException: /stylesheets/desktop/preferences.xhtml
@10,79 value="#{preferencesController.localeItems}": Error reading
'localeItems' on type
org.esupportail.blank.web.controllers.PreferencesController
....
An idea ?
--
Yves Deschamps
CRI P�le Web, Environnement Num�rique de Travail
B�timent M4
Tel : 03 20 43 41 89
Fax : 03 20 43 66 25
Blog Pro : http://blogs.univ-lille1.fr/pg/blog/ydescham