Package org.bee.tl.core

Examples of org.bee.tl.core.Template


    public void render() {
        Writer writer = null;
        OutputStream os = null;
        try {
            response.setContentType(contentType);
            Template template = gt.getFileTemplate(view);
            Enumeration<String> attrs = request.getAttributeNames();
            while (attrs.hasMoreElements()) {
                String attrName = attrs.nextElement();
                template.set(attrName, request.getAttribute(attrName));

            }
            WebVariable webVariable = new WebVariable();
            webVariable.setRequest(request);
            webVariable.setResponse(response);
            webVariable.setSession(request.getSession());
            template.set("servlet", webVariable);
            template.set("request", request);
            template.set("ctxPath", request.getContextPath());
            if (gt.isDirectByteOutput()) {
                os = response.getOutputStream();
                template.getText(os);
            } else {
                writer = response.getWriter();
                template.getText(writer);
            }

        } catch (Exception e) {
            throw new RenderException(e);
        } finally {
View Full Code Here

TOP

Related Classes of org.bee.tl.core.Template

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.