Package org.beangle.struts2.interceptor

Examples of org.beangle.struts2.interceptor.SimpleServletConfigInterceptor


   * @param param
   * @param redirectParamStr
   * @return
   */
  private Action buildAction(String path) {
    Action action = (Action) ActionContext.getContext().getContextMap().get("dispatch_action");
    if (null == action) {
      action = new Action();
      String newPath = path;
      if (path.startsWith("?")) {
        newPath = getServletPath(ServletActionContext.getRequest()) + path;
      }
      action.path(newPath);
    } else {
      if (null != action.getClazz()) {
        Action newAction = actionNameBuilder.build(action.getClazz());
        action.name(newAction.getName()).namespace(newAction.getNamespace());
      }
      if (StringUtils.isBlank(action.getName())) {
        action.path(getServletPath(ServletActionContext.getRequest()));
      }
    }
View Full Code Here


    String testResult = codeGenerator.test(codeFixture);
    if (null == testResult) {
      testResult = "null";
    }
    put("testResult", testResult);
    return forward(new Action(this.getClass(), "edit"));
  }
View Full Code Here

    return redirect("search", "info.save.success");
  }

  @Override
  public String index() {
    return forward(new Action(this, "search"));
  }
View Full Code Here

        avatarBase.updateAvatar(getUsername(), files[0], type);
      } else {
        return forward("upload");
      }
    }
    return redirect(new Action(MyAction.class, "info"), "info.upload.success");
  }
View Full Code Here

        avatarBase.updateAvatar(userName, files[0], type);
      } else {
        return forward("upload");
      }
    }
    return redirect(new Action(UserAction.class, "info", "&user.name=" + userName),
        "info.save.success");
  }
View Full Code Here

    return redirect("search", "info.save.success");
  }

  @Override
  public String index() throws Exception {
    return forward(new Action(this, "search"));
  }
View Full Code Here

    }

    entityDao.saveOrUpdate(mao);
    authorityManager.refreshGroupAuthorities(new GrantedAuthorityBean(mao.getName()));

    Action redirect = Action.to(this).method("edit");
    redirect.param("group.id", mao.getId()).param("menuProfileId", menuProfile.getId());
    String displayFreezen = get("displayFreezen");
    if (null != displayFreezen) {
      redirect.param("displayFreezen", displayFreezen);
    }
    return redirect(redirect, "info.save.success");
  }
View Full Code Here

    String errorMsg = "";
    // // 收集用户身份
    String[] categories = StringUtils.split(get("categoryIds"), ",");
    for (int i = 0; i < categories.length; i++) {
      errorMsg = checkCategory(user, Long.valueOf(categories[i]));
      if (StringUtils.isNotEmpty(errorMsg)) { return forward(new Action("edit"), errorMsg); }
    }
    // 检验用户合法性
    errorMsg = checkUser(user);
    if (StringUtils.isNotEmpty(errorMsg)) { return forward(new Action("edit"), errorMsg); }
    try {
      processPassword(user);
      if (!user.isPersisted()) {
        User creator = userService.get(getUserId());
        userService.createUser(creator, user);
View Full Code Here

   * @param clazz
   * @return
   */
  public Action build(String className) {
    Profile profile = profileService.getProfile(className);
    Action action = new Action();
    StringBuilder sb = new StringBuilder();
    // namespace
    sb.append(profile.getUriPath());
    if (Constants.SHORT_URI.equals(profile.getUriPathStyle())) {
      String simpleName = className.substring(className.lastIndexOf('.') + 1);
      sb.append(StringUtils.uncapitalize(simpleName.substring(0, simpleName.length()
          - profile.getActionSuffix().length())));
    } else if (Constants.SIMPLE_URI.equals(profile.getUriPathStyle())) {
      sb.append(profile.getInfix(className));
    } else if (Constants.SEO_URI.equals(profile.getUriPathStyle())) {
      sb.append(StrUtils.unCamel(profile.getInfix(className)));
    } else {
      throw new RuntimeException("unsupported uri style " + profile.getUriPathStyle());
    }
    action.path(sb.toString()).method(profile.getDefaultMethod()).extention(
        profile.getUriExtension());
    return action;
  }
View Full Code Here

        logger.warn("Cannot find bean definition for {}.", actionClass);
        break;
      case 1:
        Profile profile = actionBuilder.getProfileService().getProfile(
            actionClass.getName());
        Action action = actionBuilder.build(actionClass.getName());
        PackageConfig.Builder packageConfig = getPackageConfig(profile, packageConfigs,
            action, actionClass);
        if(createActionConfig(packageConfig, action, actionClass, beanNames[0])){
          createCount++;
        }
View Full Code Here

TOP

Related Classes of org.beangle.struts2.interceptor.SimpleServletConfigInterceptor

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.