Package org.nutz.mvc

Examples of org.nutz.mvc.ActionChain


   * @return true- 成功的找到一个动作链并执行。 false- 没有找到动作链
   */
  public boolean invoke(ActionContext ac) {
    HttpServletRequest req = ac.getRequest();
    String httpMethod = Strings.sNull(req.getMethod(), "GET").toUpperCase();
    ActionChain chain = chainMap.get(httpMethod);
    // 找到了特殊HTTP方法的处理动作链
    if (null != chain) {
      chain.doChain(ac);
      return true;
    }
    // 这个 URL 所有的HTTP方法用统一的动作链处理
    else if (null != defaultChain) {
      defaultChain.doChain(ac);
View Full Code Here


      Processor errorProcessor = getProcessorByName(config, co.getErrorProcessor(ai.getChainName()));
      errorProcessor.init(config, ai);
      /*
       * 返回动作链实例
       */
      ActionChain chain = new NutActionChain(list, errorProcessor);
      return chain;
    } catch (Throwable e) {
      if (logger.isDebugEnabled())
        logger.debugf("Eval FAIL!! : %s",ai.getMethod());
      throw Lang.wrapThrow(e);
View Full Code Here

    this.map = new HashMap<String, ActionInvoker>();
    this.root = new MappingNode<ActionInvoker>();
  }

  public void add(ActionChainMaker maker, ActionInfo ai, NutConfig config) {
    ActionChain chain = maker.eval(config, ai);
    for (String path : ai.getPaths()) {
      if (Strings.isBlank(path))
        throw new BlankAtException(ai.getModuleType(), ai.getMethod());

      // 尝试获取,看看有没有创建过这个 URL 调用者
View Full Code Here

     * @param ac
     *            动作链上下文
     * @return true- 成功的找到一个动作链并执行。 false- 没有找到动作链
     */
    public boolean invoke(ActionContext ac) {
        ActionChain chain = getActionChain(ac);
        if (chain == null) {
            if (log.isDebugEnabled())
                log.debugf("Not chain for req (path=%s, method=%s)", ac.getPath(), ac.getRequest().getMethod());
            return false;
        }
        chain.doChain(ac);
        return true;
    }
View Full Code Here

    }

    public ActionChain getActionChain(ActionContext ac) {
        HttpServletRequest req = ac.getRequest();
        String httpMethod = Strings.sNull(req.getMethod(), "GET").toUpperCase();
        ActionChain chain = chainMap.get(httpMethod);
        // 找到了特殊HTTP方法的处理动作链
        if (null != chain) {
            return chain;
        }
        // 这个 URL 所有的HTTP方法用统一的动作链处理
View Full Code Here

           
            if (path.charAt(0) != '/')
                paths[i] = '/' + path;
        }
       
        ActionChain chain = maker.eval(config, ai);
        for (String path : ai.getPaths()) {

            // 尝试获取,看看有没有创建过这个 URL 调用者
            ActionInvoker invoker = map.get(path);
View Full Code Here

    public ActionInvoker get(ActionContext ac) {
        String path = Mvcs.getRequestPath(ac.getRequest());
        ActionInvoker invoker = root.get(ac, path);
        if (invoker != null) {
            ActionChain chain = invoker.getActionChain(ac);
            if (chain != null) {
                if (log.isDebugEnabled()) {
                    log.debugf("Found mapping for [%s] path=%s : %s", ac.getRequest().getMethod(), path, chain);
                }
                return invoker;
View Full Code Here

     * @param ac
     *            动作链上下文
     * @return true- 成功的找到一个动作链并执行。 false- 没有找到动作链
     */
    public boolean invoke(ActionContext ac) {
        ActionChain chain = getActionChain(ac);
        if (chain == null) {
            if (log.isDebugEnabled())
                log.debugf("Not chain for req (path=%s, method=%s)", ac.getPath(), ac.getRequest().getMethod());
            return false;
        }
        chain.doChain(ac);
        return ac.getBoolean(ActionContext.AC_DONE, true);
    }
View Full Code Here

    }

    public ActionChain getActionChain(ActionContext ac) {
        HttpServletRequest req = ac.getRequest();
        String httpMethod = Strings.sNull(req.getMethod(), "GET").toUpperCase();
        ActionChain chain = chainMap.get(httpMethod);
        // 找到了特殊HTTP方法的处理动作链
        if (null != chain) {
            return chain;
        }
        // 这个 URL 所有的HTTP方法用统一的动作链处理
View Full Code Here

            Processor errorProcessor = getProcessorByName(config, co.getErrorProcessor(ai.getChainName()));
            errorProcessor.init(config, ai);
            /*
             * 返回动作链实例
             */
            ActionChain chain = new NutActionChain(list, errorProcessor, ai.getMethod());
            return chain;
        } catch (Throwable e) {
            if (logger.isDebugEnabled())
                logger.debugf("Eval FAIL!! : %s",ai.getMethod());
            throw Lang.wrapThrow(e);
View Full Code Here

TOP

Related Classes of org.nutz.mvc.ActionChain

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.