Examples of JadeConfiguration


Examples of de.neuland.jade4j.JadeConfiguration

public class JadeTemplateEngine implements TemplateEngine {

  private JadeConfiguration jadeConfig;

  public JadeTemplateEngine() {
    this(new JadeConfiguration());
  }
View Full Code Here

Examples of de.neuland.jade4j.JadeConfiguration

  @Override
  public int doStartTag() throws JspException {
    WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());

    JadeConfiguration jadeConfiguration = context.getBean(JadeConfiguration.class);
    JadeTemplate jadeTemplate = context.getBean("TemplateComment", JadeTemplate.class);

    Map<String, Object> data = Maps.newHashMap();

    data.put("comment", comment);
    data.put("enableSchema", enableSchema);
    data.put("topic", new ApiCommentTopicInfo(
            topic.getId(),
            topic.getLink(),
            commentsAllowed
    ));

    data.put("showMenu", showMenu);

    // TODO: move to globals
    data.put("dateFormat", new SignTag.DateFormatHandler());

    jadeConfiguration.renderTemplate(jadeTemplate, data, pageContext.getOut());

/*
    ObjectMapper mapper = new ObjectMapper();
    try {
      pageContext.getOut().append(mapper.writer().writeValueAsString(data.get("user")));
View Full Code Here

Examples of de.neuland.jade4j.JadeConfiguration

  @Override
  public int doStartTag() throws JspException {
    WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());

    JadeConfiguration jadeConfiguration = context.getBean(JadeConfiguration.class);
    JadeTemplate jadeTemplate = context.getBean("TemplateSign", JadeTemplate.class);

    Map<String, Object> data = Maps.newHashMap();

    data.put("user", user);
    data.put("shortMode", shortMode);
    data.put("author", author);
    data.put("postdate", postdate);

    // TODO: move to globals
    data.put("dateFormat", new DateFormatHandler());

    if (timeprop!=null) {
      data.put("timeprop", timeprop);
    }

    jadeConfiguration.renderTemplate(jadeTemplate, data, pageContext.getOut());

/*
    ObjectMapper mapper = new ObjectMapper();
    try {
      pageContext.getOut().append(mapper.writer().writeValueAsString(data.get("user")));
View Full Code Here

Examples of de.neuland.jade4j.JadeConfiguration

    return templateLoader;
  }

  @Bean
  public JadeConfiguration jadeConfiguration(SpringTemplateLoader loader) {
    JadeConfiguration cfg = new JadeConfiguration();
    cfg.setPrettyPrint(false);
    cfg.setCaching(true);
    cfg.setTemplateLoader(loader);
    return cfg;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.