Spring Framework AbstractTemplateView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AbstractTemplateView class.

This code example shows how to use the following methods:getServletContext, getUrl
		WebEngine.getEngine().getTemplate(getUrl(), request.getLocale(), model).render(model, response); 
	} 
 
	@Override 
	public boolean checkResource(Locale locale) throws Exception { 
		WebEngine.setServletContext(getServletContext()); 
		return WebEngine.getEngine().hasResource(getUrl(), locale); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
 * A handlebars view implementation. 
 * 
 * @author edgar.espina 
 * @since 0.1.0 
 */ 
public class HandlebarsView extends AbstractTemplateView { 
 
  /** 
   * The compiled template. 
   */ 
  private Template template; 
 
  /** 
   * The value's resolvers. 
   */ 
  private ValueResolver[] valueResolvers; 
 
  /** 
   * Merge model into the view. {@inheritDoc} 
   */ 
5
CodeRank
This code example shows how to use the following methods:
import java.util.Map; 
 
/** 
 * @author Sean Scanlon <sean.scanlon@gmail.com> 
 */ 
public class MustacheView extends AbstractTemplateView { 
 
    private MustacheTemplate template; 
 
    @Override 
    protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request, 
                                             HttpServletResponse response) throws Exception { 
 
        response.setContentType(getContentType()); 
        final Writer writer = response.getWriter(); 
        template.execute(model, writer); 
        writer.flush(); 
    } 
 
    public void setTemplate(MustacheTemplate template) { 
5
CodeRank
This code example shows how to use the following methods:
 
/** 
 * @author Erdinc Yilmazel (eyilmazel@tripadvisor.com) 
 * @since 6/13/13 
 */ 
public class CambridgeView extends AbstractTemplateView 
{ 
    CambridgeConfig cambridgeConfig; 
 
    public CambridgeConfig getCambridgeConfig() 
    { 
        return cambridgeConfig; 
    } 
 
    public void setCambridgeConfig(CambridgeConfig cambridgeConfig) 
    { 
        this.cambridgeConfig = cambridgeConfig; 
    } 
 
    @Override 
5
CodeRank
This code example shows how to use the following methods:
 
/** 
 * 
 * @author Zqq 
 */ 
public class WebitView extends AbstractTemplateView { 
 
    private WebitViewResolver resolver; 
 
    public void setResolver(WebitViewResolver resolver) { 
        this.resolver = resolver; 
    } 
 
    @Override 
    protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { 
        model.put("request", request); 
        model.put("response", response); 
        this.resolver.render(getUrl(), model, request, response); 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
 * 不支持jsp标签、不支持request、session、application等对象,可用于前台模板页面。 
 *  
 * @author liufang 
 *  
 */ 
public class SimpleFreeMarkerView extends AbstractTemplateView { 
	/** 
	 * 部署路径调用名称 
	 */ 
	public static final String CONTEXT_PATH = "base"; 
 
	private Configuration configuration; 
 
	public void setConfiguration(Configuration configuration) { 
		this.configuration = configuration; 
	} 
 
	protected Configuration getConfiguration() { 
		return this.configuration; 
	} 
4
CodeRank
This code example shows how to use the following methods:getServletContext, getUrl
        final String templatePath = this.getTemplatePath(); 
        response.getWriter().append(Rythm.render(templatePath, model)); 
    } 
 
    protected String getTemplatePath() { 
        return this.getServletContext().getRealPath(this.getUrl()); 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
import de.neuland.jade4j.JadeConfiguration; 
import de.neuland.jade4j.exceptions.JadeCompilerException; 
import de.neuland.jade4j.exceptions.JadeException; 
import de.neuland.jade4j.template.JadeTemplate; 
 
public class JadeView extends AbstractTemplateView { 
 
	private String encoding; 
	private JadeConfiguration configuration; 
	private boolean renderExceptions = false; 
	private String contentType; 
 
	@Override 
	protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { 
		doRender(model, response); 
	} 
 
	private void doRender(Map<String, Object> model, HttpServletResponse response) throws IOException { 
		logger.trace("Rendering Jade template [" + getUrl() + "] in JadeView '" + getBeanName() + "'"); 
 
4
CodeRank
This code example shows how to use the following methods:
 * This is the spring view use to generate the content based on 
 * a Mustache template. 
 * 
 * @author Minkyu Cho 
 */ 
public class TrimouView extends AbstractTemplateView { 
    private static final Logger logger = LoggerFactory.getLogger(TrimouView.class); 
 
    private String viewName; 
 
    private MustacheEngine engine; 
 
    @Override 
    protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request, 
                                             HttpServletResponse response) throws Exception { 
        response.setContentType(getContentType()); 
        exposeRequestAttributesAsModel(model, request); 
        final Writer writer = response.getWriter(); 
        try { 
            engine.getMustache(viewName).render(writer, model); 
4
CodeRank
This code example shows how to use the following methods:
import jetbrick.template.JetTemplate; 
import jetbrick.template.web.JetWebContext; 
import jetbrick.template.web.JetWebEngineLoader; 
import org.springframework.web.servlet.view.AbstractTemplateView; 
 
public class JetTemplateView extends AbstractTemplateView { 
 
    @Override 
    protected void renderMergedTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { 
        JetContext context = new JetWebContext(request, response, model); 
        JetTemplate template = JetWebEngineLoader.getJetEngine().getTemplate(getUrl()); 
        template.render(context, response.getOutputStream()); 
    } 
 
    @Override 
    public boolean checkResource(Locale locale) throws Exception { 
        return JetWebEngineLoader.getJetEngine().lookupResource(getUrl()); 
    } 
} 
4
CodeRank