List of usage examples for org.springframework.web.servlet DispatcherServlet VIEW_RESOLVER_BEAN_NAME
String VIEW_RESOLVER_BEAN_NAME
To view the source code for org.springframework.web.servlet DispatcherServlet VIEW_RESOLVER_BEAN_NAME.
Click Source Link
From source file:org.tangram.components.spring.TangramViewHandler.java
/** * Initialize the ViewResolvers used by this class. * <p>//from w w w. jav a 2 s. c om * If no ViewResolver beans are defined in the BeanFactory for this namespace, we default to * InternalResourceViewResolver. */ private void initViewResolvers(ApplicationContext context) { this.modelAwareViewResolvers = null; if (this.detectAllModelAwareViewResolvers) { // Find all ViewResolvers in the ApplicationContext, including ancestor contexts. Map<String, ModelAwareViewResolver> matchingBeans = BeanFactoryUtils .beansOfTypeIncludingAncestors(context, ModelAwareViewResolver.class, true, false); if (!matchingBeans.isEmpty()) { this.modelAwareViewResolvers = new ArrayList<>(matchingBeans.values()); // We keep ViewResolvers in sorted order. OrderComparator.sort(this.modelAwareViewResolvers); } // if } else { try { ModelAwareViewResolver vr = context.getBean(DispatcherServlet.VIEW_RESOLVER_BEAN_NAME, ModelAwareViewResolver.class); this.modelAwareViewResolvers = Collections.singletonList(vr); } catch (NoSuchBeanDefinitionException e) { // Ignore, we'll add a default ViewResolver later. LOG.warn("initViewResolvers()", e); } // try/catch } // if }
From source file:com.fengduo.bee.commons.velocity.Widget.java
private void initContext() throws Exception { if (viewResolver == null) { viewResolver = (ViewResolver) applicationContent.getBean(DispatcherServlet.VIEW_RESOLVER_BEAN_NAME); }/*from w ww . j av a 2s . com*/ }