Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] TypeConverter

cilquirm

2007-02-28

Replies:


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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.