beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Feit (JIRA)" <>
Subject [jira] Commented: (BEEHIVE-827) FacesMessages unavailable in JSF
Date Fri, 24 Jun 2005 17:05:03 GMT
    [ ] 

Rich Feit commented on BEEHIVE-827:

OK, I have a question and a comment:

    - If you ever get out to an action, we should destroy the current backing bean, so when
you get back to the page, onCreate() should be called (on a new instance of the backing bean).
 I have a test of this and it appears to be working (both with MyFaces and the JSF RI), but
I'm wondering if there's a difference between our apps.  Can you attach your app, or at least
a set of files I can use to reproduce the problem?

    - onCreate() will only get called when the backing bean is created, and not on subsequent
postback requests to the same JSF page.  I think you're aware of this but I want to make sure.
 If you need to execute code on every request in order to set up messages in the FacesContext,
then I think this would need to be done through JSF.  Does that make sense?

> FacesMessages unavailable in JSF
> --------------------------------
>          Key: BEEHIVE-827
>          URL:
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: v1m1
>  Environment: Sun JSF-ri, Tomcat 5.0.28
>     Reporter: Mike Arnold
>      Fix For: V1

> I created a FacesBackingBean that raises an action in the controller.  The action returns
a Forward sending the request back to the JSF.  The forward generates an ActionOutput of a
simple String message.  In the onCreate() method of the FacesBackingBean I called getPageInput()
to retrieve the ActionOutput.  I then cast the output as a string and pass it to a new FacesMessage
which is passed to FacesContext.getInstance().addMessage().  In the JSF, the message is not
displayed using the <h:messages/> tag.
> If I add the new FacesMessage to FacesContext in an event handler that does not raise
an action, the message is displayed as expected.
> If I add the new FacesMessage to FacesContext in onCreate() without going through an
action, the statement throws a NPE.
> @Override
> protected void onCreate() throws Exception {
>      FacesContext.getCurrentInstance().addMessage("foo", new FacesMessage("bar"));
> }
> Stack Trace:
> java.lang.NullPointerException
> 	at petstoreAdmin.login.onCreate(
> 	at org.apache.beehive.netui.pageflow.PageFlowManagedObject.create(
> 	at org.apache.beehive.netui.pageflow.internal.FacesBackingBeanFactory.getFacesBackingBeanForRequest(
> 	at org.apache.beehive.netui.script.common.ImplicitObjectUtil.loadImplicitObjects(
> 	at org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(
> 	at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(
> 	at org.apache.catalina.core.StandardPipeline.invoke(
> 	at org.apache.catalina.core.StandardContextValve.invokeInternal(
> 	at org.apache.catalina.core.StandardContextValve.invoke(
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(
> 	at org.apache.catalina.core.StandardPipeline.invoke(
> 	at org.apache.catalina.core.StandardHostValve.invoke(
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(
> 	at org.apache.catalina.core.StandardPipeline.invoke(
> 	at org.apache.catalina.core.StandardEngineValve.invoke(
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(
> 	at org.apache.catalina.core.StandardPipeline.invoke(
> 	at org.apache.catalina.core.ContainerBase.invoke(
> 	at org.apache.coyote.tomcat5.CoyoteAdapter.service(
> 	at org.apache.coyote.http11.Http11Processor.process(
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(
> 	at
> 	at org.apache.tomcat.util.threads.ThreadPool$
> 	at

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message