super(factory, beanAttributeRequest);
}
public ModelAndView handleRequest(final HttpServletRequest request, HttpServletResponse response) throws Exception {
final LocaleResolver localeResolver = (LocaleResolver)request.getAttribute(LOCALE_RESOLVER_ATTRIBUTE);
// Expose current LocaleResolver and request as LocaleContext.
LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
if ( previousLocaleContext.getLocale() == null ) {
LocaleContextHolder.setLocaleContext(new LocaleContext() {
public Locale getLocale() {
return localeResolver.resolveLocale(request);
}
});
}
Transformer transformer = getTransformerFactory().getTransformer(BeanTransformer.TRANSFORMER_BEAN_ID);
if (transformer == null)
return null;
View view = new SalamandraWebView(transformer, localeResolver.resolveLocale(request));
return new ModelAndView(view);
}