PDA

View Full Version : I18n messages


chrisjo
Mar 21st, 2006, 06:11 PM
I want to implement a MessageSource to resolve my messages displayed in JSP's. The messages are stored in the database and I have a simple override system for it so I need to implement my own resolver (as far as I know).

I want to do this:

For each request - fetch messages from persistent storage, and resolve overrides
Store messages in a Set
Make available through the spring message tag


Problem is that I don't know how to do certain things. In order to resolve the overrides, the resolver needs to know the class of the servlet currently in control. It also needs to know the url and locale. I would like the resolver to do it's own thing without having to force it's processing in every servlet. Also I want it to fetch messages and figure out overrides only once for each request, minimizing database access.

So, to recap:
How do I let the resolver know controller class, url and locale without setting them from every controller?
How do I make the resolver fetch all messages applicable to one page in one task and then look up the result Map for every call to getMessage?