Package org.commontemplate.core

Examples of org.commontemplate.core.Context


  }
 
  public static Context getCTLContext(){
    if(ctlEngine == null)
      return null;
    Context context = ctlContext.get();
    if(context == null){
      context = ctlEngine.createContext(new StringWriter());
      ctlContext.set(context);
    }
    return context;
View Full Code Here


  }

  protected void serialize(Serializable obj, HttpServletResponse response, String page)
      throws IOException {
    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

Related Classes of org.commontemplate.core.Context

Copyright © 2018 www.massapicom. 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.