Package org.beangle.struts2.interceptor

Examples of org.beangle.struts2.interceptor.FlashInterceptor


          buildResultParams(path, resultTypeConfig));
    } else {
      String prefix = StringUtils.substringBefore(resultCode, ":");
      resultTypeConfig = (ResultTypeConfig) resultTypeConfigs.get(prefix);
      if (prefix.startsWith("chain")) {
        Action action = buildAction(StringUtils.substringAfter(resultCode, ":"));
        Map<String, String> params = buildResultParams(path, resultTypeConfig);
        addNamespaceAction(action, params);
        if (StringUtils.isNotEmpty(action.getMethod())) {
          params.put("method", action.getMethod());
        }
        return buildResult(resultCode, resultTypeConfig, context, params);
      } else if (prefix.startsWith("redirect")) {
        String targetResource = StringUtils.substringAfter(resultCode, ":");
        if (StringUtils.contains(targetResource, ':')) { return new ServletRedirectResult(
            targetResource); }
        Action action = buildAction(targetResource);
        String redirectParamStr = ServletActionContext.getRequest().getParameter("params");
        action.params(redirectParamStr);
        Map<String, String> params = buildResultParams(path, resultTypeConfig);
        if (null != action.getParams().get("method")) {
          params.put("method", (String) action.getParams().get("method"));
          action.getParams().remove("method");
        }
        if (StringUtils.isNotEmpty(action.getMethod())) {
          params.put("method", action.getMethod());
        }
        addNamespaceAction(action, params);

        ServletRedirectResult result = (ServletRedirectResult) buildResult(resultCode,
            resultTypeConfig, context, params);
        for (Map.Entry<String, String> param : action.getParams().entrySet()) {
          String property = param.getKey();
          result.addParameter(property, param.getValue());
        }
        return result;
      } else {
View Full Code Here


   * @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() + 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());
      }
    }
View Full Code Here

import com.opensymphony.xwork2.ActionSupport;

public class DispatchAction extends ActionSupport {

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

   * @param message
   * @param params
   * @return
   */
  protected String redirect(String method, String message, String params) {
    return redirect(new Action((String) null, method, params), message);
  }
View Full Code Here

   * @param method
   * @param message
   * @return
   */
  protected String redirect(String method, String message) {
    return redirect(new Action(method), message);
  }
View Full Code Here

    if (!codeGenerator.isValidCode(code)) {
      code = codeGenerator.gen(new CodeFixture(baseCode));
      if (codeGenerator.isValidCode(code)) {
        baseCode.setCode(code);
      } else {
        return forward(new Action("edit"), "system.codeGen.failure");
      }
    }

    if (entityDao.duplicate(codeClass, codeId, "code", baseCode.getCode())) { return forward(new Action(
        "", "edit"), "error.code.existed"); }
    baseCodeService.saveOrUpdate(baseCode);
    return redirect("search", "info.save.success");
  }
View Full Code Here

    entityDao.remove(removedAuthorities);
    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

    if (!codeGenerator.isValidCode(code)) {
      code = codeGenerator.gen(new CodeFixture(baseCode));
      if (codeGenerator.isValidCode(code)) {
        baseCode.setCode(code);
      } else {
        return forward(new Action("edit"), "system.codeGen.failure");
      }
    }

    if (entityDao.duplicate(codeClass, codeId, "code", baseCode.getCode())) { return forward(new Action(
        "", "edit"), "error.code.existed"); }
    baseCodeService.saveOrUpdate(baseCode);
    return redirect("search", "info.save.success");
  }
View Full Code Here

  /**
   * forward to index method
   */
  public String execute() throws Exception {
    return forward(new Action((Class<?>) null, "index"));
  }
View Full Code Here

   * @param message
   * @param params
   * @return
   */
  protected String redirect(String method, String message, String params) {
    return redirect(new Action((String) null, method, params), message);
  }
View Full Code Here

TOP

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

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.