Examples of NoRouteFoundException


Examples of general.exceptions.NoRouteFoundException

      wc_waypoints.remove(0);
      return wc_waypoints;
    }
    else
    {
      throw new NoRouteFoundException("Konnte keine Route finden!", mc_from, mc_to);   
    }
  }
View Full Code Here

Examples of org.resthub.web.springmvc.router.exceptions.NoRouteFoundException

            request.method = "HEAD";
            if (route != null) {
                return route;
            }
        }
        throw new NoRouteFoundException(request.method, request.path);
    }
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

        String[] names = Java.parameterNames(actionMethod);
        if (param instanceof Object[]) {
          // too many parameters versus action, possibly a developer
          // error. we must warn him.
          if (names.length < ((Object[]) param).length) {
            throw new NoRouteFoundException(action, null);
          }
          Annotation[] annos = actionMethod.getAnnotations();
          for (int i = 0; i < ((Object[]) param).length; i++) {
            if (((Object[]) param)[i] instanceof Router.ActionDefinition && ((Object[]) param)[i] != null) {
              Unbinder.unBind(args, ((Object[]) param)[i].toString(), i < names.length ? names[i] : "", annos);
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

          getActionParamCache().put(action, targetParamNames);
        }
        // too many parameters versus action, possibly a developer
        // error. we must warn him.
        if (targetParamNames.length < params.length) {
          throw new NoRouteFoundException(action, null);
        }

        String k = action;
        for (String p : targetParamNames) {
          k += "_" + p;
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

                    + LocalVariablesNamesTracer.computeMethodHash(actionMethod.getParameterTypes())).get(null);
        if (param instanceof Object[]) {
          // too many parameters versus action, possibly a developer
          // error. we must warn him.
          if (names.length < ((Object[]) param).length) {
            throw new NoRouteFoundException(action, null);
          }
          for (int i = 0; i < ((Object[]) param).length; i++) {
            if (((Object[]) param)[i] instanceof Router.ActionDefinition && ((Object[]) param)[i] != null) {
              Unbinder.unBind(r, ((Object[]) param)[i].toString(), i < names.length ? names[i] : "");
            } else if (isSimpleParam(actionMethod.getParameterTypes()[i])) {
              if (((Object[]) param)[i] != null) {
                Unbinder.unBind(r, ((Object[]) param)[i].toString(), i < names.length ? names[i] : "");
              }
            } else {
              Unbinder.unBind(r, ((Object[]) param)[i], i < names.length ? names[i] : "");
            }
          }
        }
        Router.ActionDefinition def = Router.reverse(action, r);
        if (absolute) {
          def.absolute();
        }

        // if (template.template.name.endsWith(".html") ||
        // template.template.name.endsWith(".xml")) {
        def.url = def.url.replace("&", "&amp;");
        // }
        return def;
      } catch (ActionNotFoundException e) {
        throw new NoRouteFoundException(action, null);
      }
    } catch (Exception e) {
      if (e instanceof PlayException) {
        throw (PlayException) e;
      }
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

     */
    protected static void redirectToStatic(String file) {
        try {
            VirtualFile vf = Play.getVirtualFile(file);
            if (vf == null || !vf.exists()) {
                throw new NoRouteFoundException(file);
            }
            throw new RedirectToStatic(Router.reverse(Play.getVirtualFile(file)));
        } catch (NoRouteFoundException e) {
            StackTraceElement element = PlayException.getInterestingStrackTraceElement(e);
            if (element != null) {
                throw new NoRouteFoundException(file, Play.classes.getApplicationClass(element.getClassName()), element.getLineNumber());
            } else {
                throw e;
            }
        }
    }
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

                    throw new Redirect(actionDefinition.toString(), permanent);
                }
            } catch (NoRouteFoundException e) {
                StackTraceElement element = PlayException.getInterestingStrackTraceElement(e);
                if (element != null) {
                    throw new NoRouteFoundException(action, newArgs, Play.classes.getApplicationClass(element.getClassName()), element.getLineNumber());
                } else {
                    throw e;
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

        return reverse(file, false);
    }

    public static String reverse(VirtualFile file, boolean absolute) {
        if (file == null || !file.exists()) {
            throw new NoRouteFoundException("File not found (" + file + ")");
        }
        String path = file.relativePath();
        path = path.substring(path.indexOf("}") + 1);
        for (Route route : routes) {
            String staticDir = route.staticDir;
            if (staticDir != null) {
                if (!staticDir.startsWith("/")) {
                    staticDir = "/" + staticDir;
                }
                if (!staticDir.equals("/") && !staticDir.endsWith("/")) {
                    staticDir = staticDir + "/";
                }
                if (path.startsWith(staticDir)) {
                    String to = route.path + path.substring(staticDir.length());
                    if (to.endsWith("/index.html")) {
                        to = to.substring(0, to.length() - "/index.html".length() + 1);
                    }
                    if (absolute) {
                        boolean isSecure = Http.Request.current() == null ? false : Http.Request.current().secure;
                        String base = getBaseUrl();
                        if (!StringUtils.isEmpty(route.host)) {
                            // Compute the host
                          int port = Http.Request.current() == null ? 80 : Http.Request.current().get().port;
                          String host = (port != 80 && port != 443) ? route.host + ":" + port : route.host;
                          to = (isSecure ? "https://" : "http://") + host + to;
                        } else {
                            to = base + to;
                        }
                    }
                    return to;
                }
            }
        }
        throw new NoRouteFoundException(file.relativePath());
    }
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

        throw new NoRouteFoundException(file.relativePath());
    }

    public static String reverseWithCheck(String name, VirtualFile file, boolean absolute) {
        if (file == null || !file.exists()) {
            throw new NoRouteFoundException(name + " (file not found)");
        }
        return reverse(file, absolute);
    }
View Full Code Here

Examples of play.exceptions.NoRouteFoundException

                        return actionDefinition;
                    }
                }
            }
        }
        throw new NoRouteFoundException(action, args);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.