Intro/Motivation

This module allows you to build serializable messages via a fluent API. It's very extensible and provides localizable messages with numbered and/or named arguments as well as message payload. With custom message builders and custom payload it's easy to create different types of messages. The motivation of introducing an independent module is that it allows to use it with several other Java frameworks. As soon as you migrate an application to CDI/CODI the message module is already there and you can use the optimized integration. Also without using CDI you can use a highly pluggable module for localizable messages. You can integrate it with every Java based application and the used frameworks. Furthermore, it allows using a well defined and independent solution for messages instead of specific message implementations like FacesMessage s.

Dependencies

The message-module itself has no dependencies. It's also independent of CDI. However, the easiest way to bootstrap the MessageContext is to use dependency-injection.

Other Modules

The message module is the only module of MyFaces CODI which can be used stand-alone.
However, in combination with the core of CODI and the JSF module the message module can be used pre-configured for JSF applications.

Injection of a pre-configured message-context
@Inject @Jsf
private MessageContext messageContext;

Be Careful

In a JSF application it's important to use the @Jsf qualifier. This qualifier tells CODI to provide the pre-configured MessageContext for JSF.

The following image shows where the message module is placed in the big picture of MyFaces CODI.
As you see, it doesn't depend on the core. However, as soon as you use it in a JSF application the core and the JSF module of MyFaces CODI are required.

Details

Further details related to this module are available at:

  • No labels