|
From: Matt R. <li...@ra...> - 2005-04-08 16:48:51
|
On Apr 8, 2005, at 10:19 AM, Colin Sampaleanu wrote: > 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... Right, but for those using something like Tapestry or JSF - they'll need to write their own filter. Since it's such little code, I don't see the need to provide a Spring Filter as part of the core, but it might be a good idea to note the Filter (and code) in the LocaleContextHolder's javadoc. I agree that it probably shouldn't go in the CharacterEncodingFilter - I'm just always looking for filter consolidation. I can probably add the above code to an existing filter. Matt > > -- > Colin Sampaleanu > Interface21 Principal Consultant > Spring Training, Consulting and Support - "From the Source" > http://www.springframework.com > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |