I do it like so :
Map contextMap = ActionContext.getContext().getContextMap();
ApplicationContext applicationContext = (ApplicationContext) ((Map)
contextMap
.get("application")).get(
org.springframework.web.context.WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
This I discovered using a bit of trail and error.
I'm not sure if there's a better way to retrieve the servlet context from a
TypeConverter, but if there was,
you'd be able to use WebApplicationContextUtils, from the spring api.
João Vieira da Luz wrote:
>
> Hi,
>
> How can I access application context on a custom ognl.TypeConverter?
>
> Thanks,
> João
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)