Announcement Announcement Module
No announcement yet.
integration of messageContext with JSF messages Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • integration of messageContext with JSF messages

    I am using JSF 1.1 pages with the JSF message tag for global and form field messages. When using web flow 2.0.9, what is the easiest way to get a custom message to display that comes from the backend. The middle tier delivers message text when there is an error, and we want to display this to the user as it is. I know there is a messageContext variable available in the flow, but how do I add the message to it from the Java code I am invoking and get it to display in the JSF tag without having to use a spring-specific tag? Previously, we just invoked the FacesContext and added the message through the current instance. This is not available at the beginning of the web flow.

  • #2
    You will need to use a MessageBuilder, and add the built message to the MessageContext.

    See the SWF reference guide for usage.


    • #3

      I have modified my code so that I pass in the messageContext parameter as shown in the examples and then add the message accordingly. It doesn't seem to end up in the faces message object when displayed on the JSP page, though. Do I need to insert the modified MessageContext back into the request or session to get it recognized? From the documentation, it would seem that it is automatic. Maybe I am missing a step or something.


      • #4
        Keep in mind JSF id's are often prefixed, usually by the containing form's id. Also, play around with the globalOnly attribute of your h:messages and see what happens.