i have a JSF/Seam Page and added a new not HTML Interface. I reused the business logic, so StatusMessages.instance().add is used everywhere.
Is there a default way to access and handle this StatusMessages from Java or do i have to extend the base class and pass the protected messages list?
thx
Edit:
StatusMessages.instance().add(Severity.ERROR, "Please enter a username.");
The FacesMessages is not returning his own messages List (where i saw the entry in the debugger) (FacesMessages.instance() is the same object as StatusMessages.instance() )
FacesMessages.instance().getCurrentMessages();
It is calling this
FacesContext.getCurrentInstance().getMessages();
and this is returning an empty iterator.
StatusMessagesis abstraction for handing messages in a way that is not dependent on the view technology you are using.Default implementation of this abstraction is
org.jboss.seam.faces.FacesMessages. This is included in Seam for use with JSF.If are reusing you business logic with another view technology you could provide your specific
StatusMessagesimplementation. Actually, that’s why this is an abstraction.Because of
@Installprecedence this will automatically be used in allStatusMessages.instance().