users@javaserverfaces.java.net

JSF 1.2: FacesMessage and FacesContext renderResponse method question

From: Todd Patrick <Todd.Patrick_at_dtn.com>
Date: Thu, 1 Feb 2007 10:55:57 -0600

JSF 1.2 Sun Java System Application Server Platform Edition 9.0_01 (build b14) I have the following in my .jsp file: <h:messages id="searchResultsMsg" styleClass="alert"/> In my Class file, I have: FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage message = new FacesMessage(); message.setSeverity(FacesMessage.SEVERITY_ERROR); message.setSummary("No customers containing all your search terms were found."); message.setDetail("Suggestions:\n" + "Make sure all words are spelled correctly.\n" + "Try different keywords.\n" + "Try more general keywords.\n" + "Try fewer keywords."); facesContext.addMessage("customerForm:searchResultsMsg", message); facesContext.renderResponse(); While debugging, I check the facesContext object after the line: facesContext.renderResponse(); There is a single componentMessageLists Map entry, so there is a valid message object in the facesContext. However, the h:messages is never render after the lifecycle has completed. Is there a 1.2 way of displaying FacesMessage from a Class file? Thanks, --Todd ----------------------------------------- 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.