Search in sources :

Example 1 with DefaultTemplateViewResolver

use of cn.taketoday.web.view.template.DefaultTemplateViewResolver in project today-framework by TAKETODAY.

the class HandlerMethodTests method setResultHandlers.

private void setResultHandlers(HandlerMethod produceMethod, ApplicationContext applicationContext) {
    final ReturnValueHandlerManager resultHandlers = new ReturnValueHandlerManager();
    resultHandlers.setApplicationContext(applicationContext);
    resultHandlers.setViewResolver(new DefaultTemplateViewResolver());
    resultHandlers.registerDefaultHandlers();
}
Also used : DefaultTemplateViewResolver(cn.taketoday.web.view.template.DefaultTemplateViewResolver) ReturnValueHandlerManager(cn.taketoday.web.handler.ReturnValueHandlerManager)

Example 2 with DefaultTemplateViewResolver

use of cn.taketoday.web.view.template.DefaultTemplateViewResolver in project today-framework by TAKETODAY.

the class ViewResolverRegistry method defaults.

/**
 * Register framework expression language supports view resolver with the
 * specified prefix and suffix.
 * <p>When this method is invoked more than once, each call will register a
 * new ViewResolver instance.
 */
public UrlBasedViewResolverRegistration defaults(String prefix, String suffix) {
    DefaultTemplateViewResolver resolver = new DefaultTemplateViewResolver();
    resolver.setPrefix(prefix);
    resolver.setSuffix(suffix);
    viewResolvers.add(resolver);
    return new UrlBasedViewResolverRegistration(resolver);
}
Also used : DefaultTemplateViewResolver(cn.taketoday.web.view.template.DefaultTemplateViewResolver)

Aggregations

DefaultTemplateViewResolver (cn.taketoday.web.view.template.DefaultTemplateViewResolver)2 ReturnValueHandlerManager (cn.taketoday.web.handler.ReturnValueHandlerManager)1