Package jetbrick.template

Examples of jetbrick.template.JetContext


     * @param file layout 模板路径
     *
     * @since 1.1.1
     */
    public static void layout(JetTagContext ctx, String file, Map<String, Object> parameters) {
        JetContext context;
        if (parameters == null || parameters.size() == 0) {
            context = ctx.getContext();
        } else {
            context = new JetContext(ctx.getContext(), parameters);
        }
        String bodyContent = ctx.getBodyContent();
        ctx.getContext().put("bodyContent", bodyContent);

        file = ctx.getPageContext().getAbsolutionName(file);
View Full Code Here


@SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast" })
public final class text_002dplain_jetx extends JetPage {

    @Override
    public void render(final JetPageContext $ctx) throws Throwable {
        final JetContext context = $ctx.getContext();
        final JetWriter $out = $ctx.getWriter();
        $out.print($txt_1, $txt_1_bytes);
        $out.flush();
    }
View Full Code Here

        if (relativeName == null || relativeName.length() == 0) {
            throw new IllegalArgumentException("argument relativeName is null or empty.");
        }
        String file = ctx.getAbsolutionName(relativeName);
        JetTemplate template = ctx.getEngine().getTemplate(file);
        JetContext context = new JetContext(ctx.getContext(), parameters);
        JetWriter writer = ctx.getWriter();
        template.render(context, writer);
    }
View Full Code Here

        if (relativeName == null || relativeName.length() == 0) {
            throw new IllegalArgumentException("argument relativeName is null or empty.");
        }
        String file = ctx.getAbsolutionName(relativeName);
        JetTemplate template = ctx.getEngine().getTemplate(file);
        JetContext context = new JetContext(ctx.getContext(), parameters);

        UnsafeCharArrayWriter os = new UnsafeCharArrayWriter();
        template.render(context, os);
        return os.toString();
    }
View Full Code Here

    public void render() {
        if (JetWebEngineLoader.unavailable()) {
            JetWebEngineLoader.setServletContext(JFinal.me().getServletContext());
        }

        JetContext context = new JetWebContext(request, response);
        JetTemplate template = JetWebEngineLoader.getJetEngine().getTemplate(view);
        try {
            template.render(context, response.getOutputStream());
        } catch (IOException e) {
            throw ExceptionUtils.uncheck(e);
View Full Code Here

        super(value);
    }

    @Override
    public void render(HttpServletRequest req, HttpServletResponse resp, Object obj) throws Throwable {
        JetContext context = new JetWebContext(req, resp);
        JetTemplate template = JetWebEngineLoader.getJetEngine().getTemplate(evalPath(req, obj));
        try {
            template.render(context, resp.getOutputStream());
        } catch (IOException e) {
            throw Lang.wrapThrow(e);
View Full Code Here

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());
    }
View Full Code Here

        if (JetWebEngineLoader.unavailable()) {
            ServletContext servletContext = (ServletContext) model.get(ServletActionContext.SERVLET_CONTEXT);
            JetWebEngineLoader.setServletContext(servletContext);
        }

        JetContext context = new JetWebContext(request, response, null);
        context.put("action", ai.getAction());
        context.put("valueStack", model);
        JetTemplate template = JetWebEngineLoader.getJetEngine().getTemplate(location);
        template.render(context, response.getOutputStream());
    }
View Full Code Here

TOP

Related Classes of jetbrick.template.JetContext

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.