Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

messages for an action

Eduardo Alfonso
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I've been trying to show messages as a result from an action. I think it's a natural way for an application to interact with the user, but haven't found it "natural" and easy to do in JSF.

The messages are appended to the FacesContext, but when processing you have no access to the FacesContext.

A validation method in a bean receives the FacesContext as parameter but this is not true for processing methods. When you bind the action of a submit button to a method in a backing bean as in the example below, that method should not have parameters, otherwise JSF are unable to find it.

<h:commandButton id="submit" action="#{Bean.process}" value="go" />

The result of this situation is that you perform the processing tasks but can't report its result to the client.

How can I do that ?

Processing in the validator methods ?? I think this is awful !!!

Any ideas ?

Thanks in advance !


note: by the way, I'm new to JSF, I could be missing something important relative to messages, so there could be my solution. Hope someone can help!. Thanks again.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic