Examples of ActionDefinition


Examples of play.mvc.Router.ActionDefinition

   */
  @Override
  public String lookup(String actionString, Object[] params) {
    ActionBridge ab = new ActionBridge(false);

    ActionDefinition ad = ab.invokeMethod(actionString, params);
    return ad.toString();
  }
View Full Code Here

Examples of play.mvc.Router.ActionDefinition

           * sub.setVariablePrefix("{"); sub.setVariableSuffix("}");
           * String url = sub.replace(urlPattern); return url; }
           */
          return null;
        } else {
          ActionDefinition actionDef = Router.reverse(action, paramMap);
          // was doing some hacking for caching. don't do it now for
          // Compatibility with remote
          // Route route = actionDef.route;
          // // find is the route is cacheable. it's hard to cache
          // path
          // // with constrained parameter
          // //
          // String path = route.path;
          // if (!path.contains("<")) {
          // // cacheable
          // if (path.endsWith("?"))
          // path = path.substring(0, path.length() - 1);
          // getActionCache().put(k, path);
          // }
          return actionDef.toString();
        }
      } catch (ActionNotFoundException e) {
        throw new RuntimeException(e + ". No matching route in reverse lookup: " + actionString);
//        throw new NoRouteFoundException(action, null);
      }
View Full Code Here

Examples of play.mvc.Router.ActionDefinition

                }

            }
            try {

                ActionDefinition actionDefinition = Router.reverse(action, newArgs);

                if (_currentReverse.get() != null) {
                    ActionDefinition currentActionDefinition = _currentReverse.get();
                    currentActionDefinition.action = actionDefinition.action;
                    currentActionDefinition.url = actionDefinition.url;
                    currentActionDefinition.method = actionDefinition.method;
                    currentActionDefinition.star = actionDefinition.star;
                    currentActionDefinition.args = actionDefinition.args;
View Full Code Here

Examples of play.mvc.Router.ActionDefinition

     * }
     * String url = action.url;
     * </code>
     */
    protected static ActionDefinition reverse() {
        ActionDefinition actionDefinition = new ActionDefinition();
        _currentReverse.set(actionDefinition);
        return actionDefinition;
    }
View Full Code Here

Examples of yalp.mvc.Router.ActionDefinition

    public static void _jsRoute(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) {
        final Object arg = args.get("arg");
        if (!(arg instanceof ActionDefinition)) {
            throw new TemplateExecutionException(template.template, fromLine, "Wrong parameter type, try #{jsRoute @Application.index() /}", new TagInternalException("Wrong parameter type"));
        }
        final ActionDefinition action = (ActionDefinition) arg;
        out.print("{");
        if (action.args.isEmpty()) {
            out.print("url: function() { return '" + action.url.replace("&amp;", "&") + "'; },");
        } else {
            out.print("url: function(args) { var pattern = '" + action.url.replace("&amp;", "&") + "'; for (var key in args) { pattern = pattern.replace(':'+key, args[key] || ''); } return pattern; },");
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.