|
From: Colin S. <col...@ex...> - 2005-04-08 16:19:14
|
Matt Raible wrote: > > On Apr 8, 2005, at 7:32 AM, Matt Sgarlata wrote: > >> Are you proposing to remove the Context interface or to move it to >> Spring core? I think moving it to Spring core could be good. >> However, I would make it a blank interface and add a >> ValidatableContext subinterface that defines the validate() method. >> >> Could we have the LocaleContext also be automatically setup in the >> DelegatingRequestProcessor for Struts users? Alternatively, perhaps >> some of the work that's currently done by the DispatcherServlet could >> be moved to a servlet filter that could work with any web >> application? For backwards compatability, the DispatcherServlet >> could detect whether the new filter has already been invoked, and if >> not invoke it manually. > > > If I understand these classes correctly, it should be fairly simple to > add this to your own filter: > > LocaleContextHolder.setLocale(request.getLocale()); > > I wonder if adding this to the CharacterEncodingFilter would make any > sense? > For people using Spring MVC you definitely still want to have DispatcherServlet do it (whether directly as now, or by reusing common code), without people having to put in the filter. I'm not so sure about combining the functionality into the CharacterEncodingFilter. Somewhat different concerns here, and you might want to handle the locale without touching the character encoding... -- Colin Sampaleanu Interface21 Principal Consultant Spring Training, Consulting and Support - "From the Source" http://www.springframework.com |