I don't dispute that this is a valid use case for managing message resources -- just that there should be a better way to achieve it than building in a dependency on the Servlet API in such a core class.
Unfortunately, the current API doesn't provide for any bootstrapping or initialization of the MessageResourcesFactory in a way which would give a cleaner way to make a ServletContext available.
I could imagine adding an initialize method to the MessageResourcesFactory API which passed in a "StrutsContext" or other more API neutral object which could be cast to a "ServletStrutsContext" which would have a "getServletContext" method. Does commons-resources give any help for this or does it inherit the same limitations as Struts' implementation?
An interim solution might be to "hotwire" something like a plugin or servlet context listener which placed your subclass of MessageResourcesFactory into the ServletContext under the same key that Struts would otherwise use.
Just a few ideas. Please don't take it as stonewalling! ;^)
Joe
At 8:56 AM +0100 1/4/05, Nicolas De Loof wrote:
Hi all,
What do you think about this enhancement request :
+ add a servletcontext attribute (+get/set) to MessageResourcesFactory and set it from ActionServlet.initModuleMessageResources()
This would allow some MessageResourceFactory implementation to get config or resources from servletcontext
+ Create a JstlMessageResourceFactory in struts-el contrib that shares messages with JSTL using the LocalizationContext stored in servletcontext
This would allow to use a custom LocalizationContext instead of properties based resourcebundle.
Nico.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]