On Mon, 01 Sep 2014 18:07:17 -0300, Dimitris Zenios <dimitris.zen...@gmail.com> wrote:

Hello everyone

Hi!

I am trying to find ways in order to contribute custom message sources
other than properties file (Database for example).Is there an easy way to
achieve that other than overriding ComponentMessagesSource service?

Yes!

I started by viewing the  tapestry-core code and I found out that
ComponentMessagesSource uses MessageSource in order to get the Messages but unfortunately MessagesSourceImpl cannot be overridden since its not
declared as normal tapestry service but constructed at
ComponentMessagesSourceImpl constructor

MessagesSource and MessagesSourceImpl are internal classes and you should avoid using them directly. In addition, you don't need them at all. All you need to do is to:

1) Write your own Messages implementation, say MyMessages.
2) Decorate or advise ComponentMessagesSource to return MyMessages according to the logic you want in the methods that return Messages.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to