Package play.exceptions

Examples of play.exceptions.TemplateExecutionException


    @SuppressWarnings("unchecked")
    public static void _include(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) {
        try {
            if (!args.containsKey("arg") || args.get("arg") == null) {
                throw new TemplateExecutionException(template.template, fromLine, "Specify a template name", new TagInternalException("Specify a template name"));
            }
            String name = args.get("arg").toString();
            if (name.startsWith("./")) {
                String ct = BaseTemplate.currentTemplate.get().name;
                if (ct.matches("^/lib/[^/]+/app/views/.*")) {
View Full Code Here


    @SuppressWarnings("unchecked")
    public static void _render(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) {
        try {
            if (!args.containsKey("arg") || args.get("arg") == null) {
                throw new TemplateExecutionException(template.template, fromLine, "Specify a template name", new TagInternalException("Specify a template name"));
            }
            String name = args.get("arg").toString();
            if (name.startsWith("./")) {
                String ct = BaseTemplate.currentTemplate.get().name;
                if (ct.matches("^/lib/[^/]+/app/views/.*")) {
View Full Code Here

                        .toString() : null;
                out.print("<img src=\"" + Mailer.getEmbedddedSrc(src, name)
                        + "\" " + serialize(args, "src", "name") + "/>");
            }
        } else {
            throw new TemplateExecutionException(template.template, fromLine,
                    "Specify a file name", new TagInternalException(
                            "Specify a file name"));
        }
    }
View Full Code Here

                    }
                    throw new NoRouteFoundException(ex.getAction(), ex.getArgs(), this, this.linesMatrix.get(stackTraceElement.getLineNumber()));
                } else if (e instanceof TemplateExecutionException) {
                    throw (TemplateExecutionException) cleanStackTrace(e);
                } else {
                    throw new TemplateExecutionException(this, this.linesMatrix.get(stackTraceElement.getLineNumber()), e.getMessage(), cleanStackTrace(e));
                }
            }
            if (stackTraceElement.getLineNumber() > 0 && Play.classes.hasClass(stackTraceElement.getClassName())) {
                throw new JavaExecutionException(Play.classes.getApplicationClass(stackTraceElement.getClassName()), stackTraceElement.getLineNumber(), cleanStackTrace(e));
            }
View Full Code Here

  public static void _escapejs(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) {
    if (!args.containsKey("arg") || args.get("arg") == null) {
      final String msg = "Specify a template name";
      TagInternalException internalException = new TagInternalException(msg);
      throw new TemplateExecutionException(template.template, fromLine, msg, internalException);
    }

    try {
      Template tmpl = TemplateLoader.load(args.get("arg").toString());
      Map<String, Object> newArgs = new HashMap<String, Object>();
View Full Code Here

TOP

Related Classes of play.exceptions.TemplateExecutionException

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.