Package org.commontemplate.core

Examples of org.commontemplate.core.Template.render()


      this.context.put(SecurityContext.CURRENT_USER_ROlE, userPrincipal);
      this.context.put(SecurityContext.USER_IS_LOGIN, userPrincipal!=null);
      this.context.put("ctx", result);
      this.context.put("xctx",session.getAttribute(HtmlResponseWriter.OPTION_KEY));
     
      template.render(this.context);
     
      String content = this.context.getOut().toString();
     
      //输出到页面
      out.write(content.getBytes("utf-8"));
View Full Code Here


    Template template = engine.getTemplate(page);
    Context context = engine.createContext(response.getWriter());
    try {
      context.pushLocalContext(new ModelMap(obj));
      context.setLocale(getLocale());
      template.render(context);
    } finally {
      context.clear();
    }
  }
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.