Package org.apache.tiles.freemarker

Examples of org.apache.tiles.freemarker.FreeMarkerTilesException


    public void commit() {
        servlet = new AttributeValueFreemarkerServlet();
        try {
            servlet.init(new InitParamsServletConfig());
        } catch (ServletException e) {
            throw new FreeMarkerTilesException(
                    "Cannot initialize internal servlet", e);
        }
    }
View Full Code Here


                try {
                    servlet.doGet(httpRequest,
                            new ExternalWriterHttpServletResponse(httpResponse,
                                    request.getPrintWriter()));
                } catch (ServletException e) {
                    throw new FreeMarkerTilesException("Exception when rendering a FreeMarker attribute", e);
                }
            } else {
                throw new InvalidTemplateException(
                        "Cannot render a template that is not a string: "
                                + value.toString());
View Full Code Here

    public static HttpRequestHashModel getRequestHashModel(Environment env) {
        try {
            return (HttpRequestHashModel) env.getDataModel().get(
                    FreemarkerServlet.KEY_REQUEST);
        } catch (TemplateModelException e) {
            throw new FreeMarkerTilesException(
                    "Exception got when obtaining the request hash model", e);
        }
    }
View Full Code Here

            Environment env) {
        try {
            return (ServletContextHashModel) env.getDataModel().get(
                    FreemarkerServlet.KEY_APPLICATION);
        } catch (TemplateModelException e) {
            throw new FreeMarkerTilesException(
                    "Exception got when obtaining the application hash model",
                    e);
        }
    }
View Full Code Here

     */
    public static String getAsString(TemplateModel model) {
        try {
            return (String) DeepUnwrap.unwrap(model);
        } catch (TemplateModelException e) {
            throw new FreeMarkerTilesException("Cannot unwrap a model", e);
        }
    }
View Full Code Here

    public static boolean getAsBoolean(TemplateModel model, boolean defaultValue) {
        try {
            Boolean retValue = (Boolean) DeepUnwrap.unwrap(model);
            return retValue != null ? retValue : defaultValue;
        } catch (TemplateModelException e) {
            throw new FreeMarkerTilesException("Cannot unwrap a model", e);
        }
    }
View Full Code Here

     */
    public static Object getAsObject(TemplateModel model) {
        try {
            return DeepUnwrap.unwrap(model);
        } catch (TemplateModelException e) {
            throw new FreeMarkerTilesException("Cannot unwrap a model", e);
        }
    }
View Full Code Here

        if ("page".equals(scope)) {
            try {
                TemplateModel model = env.getObjectWrapper().wrap(obj);
                env.setVariable(name, model);
            } catch (TemplateModelException e) {
                throw new FreeMarkerTilesException(
                        "Error when wrapping an object", e);
            }
        } else if ("request".equals(scope)) {
            getRequestHashModel(env).getRequest().setAttribute(name, obj);
        } else if ("session".equals(scope)) {
View Full Code Here

    public void commit() {
        servlet = new AttributeValueFreemarkerServlet();
        try {
            servlet.init(new InitParamsServletConfig());
        } catch (ServletException e) {
            throw new FreeMarkerTilesException(
                    "Cannot initialize internal servlet", e);
        }
    }
View Full Code Here

                try {
                    servlet.doGet(httpRequest,
                            new ExternalWriterHttpServletResponse(httpResponse,
                                    request.getPrintWriter()));
                } catch (ServletException e) {
                    throw new FreeMarkerTilesException("Exception when rendering a FreeMarker attribute", e);
                }
            } else {
                throw new InvalidTemplateException(
                        "Cannot render a template that is not a string: "
                                + value.toString());
View Full Code Here

TOP

Related Classes of org.apache.tiles.freemarker.FreeMarkerTilesException

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.