users@javaserverfaces.java.net

Re: h:message - Warning: FacesMessage(s) have been enqueued, but may not have been displayed.

From: Imre Oßwald <io_at_mx.jevelopers.com>
Date: Sat, 10 Mar 2007 16:39:43 +0100

I think the h:message-"box" will display FacesMessages for "filer",
so you should change
"tbForm:transactionBrowserBorder:searchErrorFilter" to the path to
the "filter" component.
(To check if the message would display at all you should put a global
<h:messages to have all messages displayed)

Imre


Am 09.03.2007 um 18:06 schrieb Michael Youngstrom:

> That warning is not stopping your message from being displayed. It is
> telling you that it may not have been displayed. And since apparently
> it was not displayed it must be right. :) Where are you adding this
> message to the FacesContext? Is this exception thrown and message
> queued during renderResponse? If so is it happening before or after
> your h:message tag is rendered?
>
> Mike
>
>
>
> On 3/9/07, Todd Patrick <Todd.Patrick_at_dtn.com> wrote:
>> 1.) I have the following in my .jsp page:
>>
>> <h:message id="searchErrorFilter"
>> for="filter"
>> showDetail="true"
>> showSummary="false"
>> styleClass="Error"/>
>>
>>
>> 2.) I want to display the h:message component when I catch the
>> following
>> exception:
>>
>> if (results.isEmpty()) {
>> throw new PetroException("No Results");
>>
>>
>> .... snippet ...
>>
>>
>> } catch (PetroException e) {
>> message.setSeverity(FacesMessage.SEVERITY_ERROR);
>> message.setSummary(e.getMessage());
>>
>> context.addMessage
>> ("tbForm:transactionBrowserBorder:searchErrorFilter",
>> message);
>> logger.error("Transaction Browser Exception:", e);
>> }
>>
>> FacesContext.getCurrentInstance().renderResponse();
>>
>> 3.) However, what happens - the error is logged correctly, but I get
>> this warning message:
>>
>> WARNING: FacesMessage(s) have been enqueued, but may not have been
>> displayed.
>>
>> I'm not for sure what causes this warning and why it prevents my
>> h:message component to be displayed. I'd appreciate any thoughts or
>> directions on this.
>>
>> Thanks,
>>
>> --Todd
>>
>>
>> [server.log]
>>
>> [#|2007-03-09T08:55:00.310-0600|INFO|sun-appserver-pe9.0|
>> javax.enterpris
>> e.system.stream.out|
>> _ThreadID=15;_ThreadName=httpWorkerThread-8080-0;|15
>> 846 [httpWorkerThread-8080-0] ERROR
>> com.dtn.petro2.petroadmin.transactionbrowser.TransactionBrowser -
>> Transaction Browser Exception:
>> com.dtn.petro2.petro_lib.PetroException: Empty Results.
>> |#]
>>
>> [#|2007-03-09T08:55:00.454-0600|INFO|sun-appserver-pe9.0|
>> javax.enterpris
>> e.resource.webcontainer.jsf.lifecycle|
>> _ThreadID=15;_ThreadName=httpWorke
>> rThread-8080-0;
>> sourceId=tbForm:transactionBrowserBorder:searchErrorFilter
>> [severity=(ERR
>> OR 2), summary=(Empty Results.), detail=(Empty Results.)];|WARNING:
>> FacesMessage(s) have been enqueued, but may not have been displayed.
>> sourceId=tbForm:transactionBrowserBorder:searchErrorFilter
>> [severity=(ERR
>> OR 2), summary=(Empty Results.), detail=(Empty Results.)]|#]
>> -----------------------------------------
>> NOTICE: This email message is for the sole use of the intended
>> recipient(s)
>> and may contain confidential and privileged information. Any
>> unauthorized
>> use, disclosure or distribution is prohibited. If you are not the
>> intended
>> recipient, please contact the sender by reply email and destroy all
>> copies
>> of the original message.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-
>> unsubscribe_at_javaserverfaces.dev.java.net
>> For additional commands, e-mail: users-
>> help_at_javaserverfaces.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-
> help_at_javaserverfaces.dev.java.net
>