Hey Darius,

I did this in non-Activator-way by using ServletContextAware in one of my modules. All it takes is to register a class with Spring that implements ServletContextAware, and you can add whatever code you need. You can also use ApplicationContextAware, depending on the exact timing you need, and whether or not you need access to the ServletContext or ApplicationContext. By registering this either in the webModuleApplicationContext.xml or via Spring annotations, you can do it cleanly in the web-layer.

http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/ServletContextAware.html
http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/context/ApplicationContextAware.html

See:
https://svn.openmrs.org/openmrs-modules/pihhaiti/web/src/org/openmrs/module/pihhaiti/web/CustomBrandingInitializer.java
https://svn.openmrs.org/openmrs-modules/pihhaiti/metadata/webModuleApplicationContext.xml

Mike

On 04/23/2012 03:49 PM, Darius Jazayeri wrote:
Hi All,

I would like something to happen in the web layer (i.e. the omod project) of the RESTWS module, whenever spring is refreshed.

I'm allowed to use the 1.7+ module activator framework, so I have access to the contextRefreshed() callback, but is there a clean best-practice way of using web-layer classes at that point?

-Darius
------------------------------------------------------------------------
Click here to unsubscribe <mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to