Version 4.10.0

hirondelle.web4j.model
Interface MessageList

All Known Implementing Classes:
AppException, DAOException, DuplicateException, ForeignKeyException, MessageListImpl, ModelCtorException

public interface MessageList

List of AppResponseMessage objects to be shown to the user.

Used for error messages, success messages, or any such item communicated to the user. See displayMessages.tag in the example application for an illustration of rendering a MessageList.

If a message needs to survive a redirect, it must be placed in session scope, not request scope. Typically, successful edits to the database use a redirect (to avoid the duplicate-upon-browser-reload problem), so success messages will almost always be placed in session scope. Conversely, failure messages will usually be placed in request scope.

Design Note
The forces which WEB4J resolves are :

This item is provided as an interface because AppException needs to be both an Exception and a MessageList.


Method Summary
 void add(AppException aAppEx)
          Add all AppResponseMessages attached to aAppEx to this list.
 void add(String aErrorMessage)
          Add a simple AppResponseMessage to this list.
 void add(String aErrorMessage, Object... aParams)
          Add a compound AppResponseMessage to this list.
 List<AppResponseMessage> getMessages()
          Return an unmodifiable List of AppResponseMessages.
 boolean isEmpty()
          Return true only if there are no messages in this list.
 boolean isNotEmpty()
          Return the negation of isEmpty().
 

Method Detail

add

void add(String aErrorMessage)
Add a simple AppResponseMessage to this list.

The argument satisfies the same conditions as AppResponseMessage.forSimple(java.lang.String).


add

void add(String aErrorMessage,
         Object... aParams)
Add a compound AppResponseMessage to this list.

The arguments satisfy the same conditions as AppResponseMessage.forCompound(java.lang.String, java.lang.Object...).


add

void add(AppException aAppEx)
Add all AppResponseMessages attached to aAppEx to this list.


isEmpty

boolean isEmpty()
Return true only if there are no messages in this list.

Note that this method name conflicts with the empty keyword of JSTL. Thus, isNotEmpty() is supplied as an alternative.


isNotEmpty

boolean isNotEmpty()
Return the negation of isEmpty().


getMessages

List<AppResponseMessage> getMessages()
Return an unmodifiable List of AppResponseMessages.


Version 4.10.0

Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.