Package jodd.madvoc

Examples of jodd.madvoc.ActionConfig


    public void bind() {
      if (actionMethodString != null) {
        actionClassMethod = actionMethodParser.resolveActionMethod(actionClass, actionMethodString);
      }

      ActionConfig actionConfig =
          actionMethodParser.createActionConfig(
              actionClass, actionClassMethod,
              actionFilters, actionInterceptors,
              actionPath, method, async, null);
View Full Code Here


      String httpMethod = servletRequest.getMethod().toUpperCase();

      actionPath = actionPathRewriter.rewrite(servletRequest, actionPath, httpMethod);

      // resolve action configuration
      ActionConfig actionConfig = actionsManager.lookup(actionPath, httpMethod);
      if (actionConfig == null) {
        return actionPath;
      }
      if (log.isDebugEnabled()) {
        log.debug("Invoking action path '" + actionPath + "' using " + actionConfig.actionClass.getSimpleName());
      }

      // set character encoding
      if (!characterEncodingSet && madvocConfig.isApplyCharacterEncoding()) {

        String encoding = madvocConfig.getEncoding();

        if (encoding != null) {
          servletRequest.setCharacterEncoding(encoding);
          servletResponse.setCharacterEncoding(encoding);
        }

        characterEncodingSet = true;
      }

      // create action object
      Object action = createAction(actionConfig.actionClass);

      // create action request
      ActionRequest previousRequest = actionRequest;
      actionRequest = createActionRequest(actionPath, actionConfig, action, servletRequest, servletResponse);
      actionRequest.setPreviousActionRequest(previousRequest);

      // invoke and render
      if (actionConfig.isAsync()) {
        AsyncContext asyncContext = servletRequest.startAsync();
        executor.execute(new ActionRequestInvoker(asyncContext, actionRequest));
      } else {
        actionRequest.invoke();
      }
View Full Code Here

        }
      }
    }


    return new ActionConfig(
        actionClass,
        actionClassMethod,
        filters,
        interceptors,
        actionPath,
View Full Code Here

  /**
   * Registration main point. Optionally, if action path with the same name already exist,
   * exception will be thrown. Returns created {@link ActionConfig}.
   */
  protected ActionConfig registerAction(Class actionClass, Method actionMethod, String actionPath) {
    ActionConfig actionConfig = actionMethodParser.parse(actionClass, actionMethod, actionPath);
    if (actionConfig == null) {
      return null;
    }
    return registerAction(actionConfig);
  }
View Full Code Here

  /**
   * @see #registerAction(Class, java.lang.reflect.Method, String)
   */
  protected ActionConfig registerAction(Class actionClass, String actionMethodName, String actionPath) {
    ActionConfig actionConfig = actionMethodParser.parse(actionClass, actionMethodName, actionPath);
    if (actionConfig == null) {
      return null;
    }
    return registerAction(actionConfig);
  }
View Full Code Here

    // 1st try: the map

    ActionConfigSet actionConfigSet = map.get(actionPath);
    if (actionConfigSet != null) {
      ActionConfig actionConfig = actionConfigSet.lookup(method);
      if (actionConfig != null) {
        return actionConfig;
      }
    }
View Full Code Here

   * Lookups value as an alias and, if not found, as a default alias.
   */
  protected String lookupAlias(String alias) {
    String value = actionsManager.lookupPathAlias(alias);
    if (value == null) {
      ActionConfig cfg = actionsManager.lookup(alias);
      if (cfg != null) {
        value = cfg.actionPath;
      }
    }
    return value;
View Full Code Here

* Injects macro values from action path into the action bean.
*/
public class ActionPathMacroInjector implements Injector {

  public void inject(ActionRequest actionRequest) {
    ActionConfig config = actionRequest.getActionConfig();
    ActionConfigSet set = config.getActionConfigSet();

    if (set.actionPathMacros == null) {
      return;
    }

View Full Code Here

  @Override
  protected synchronized ActionConfig registerAction(Class actionClass, Method actionMethod, String actionPath) {
    if (proxetta != null) {
      // create action path from existing class (if not already exist)
      if (actionPath == null) {
        ActionConfig cfg = actionMethodParser.parse(actionClass, actionMethod, actionPath);
        actionPath = cfg.actionPath;
      }
      // create proxy for action class if not already created
      Class existing = proxyActionClasses.get(actionClass);
      if (existing == null) {
View Full Code Here

      String httpMethod = servletRequest.getMethod().toUpperCase();

      actionPath = actionPathRewriter.rewrite(servletRequest, actionPath, httpMethod);

      // resolve action configuration
      ActionConfig actionConfig = actionsManager.lookup(actionPath, httpMethod);
      if (actionConfig == null) {
        return actionPath;
      }
      if (log.isDebugEnabled()) {
        log.debug("Invoking action path '" + actionPath + "' using " + actionConfig.actionClass.getSimpleName());
      }

      // set character encoding
      if (!characterEncodingSet && madvocConfig.isApplyCharacterEncoding()) {

        String encoding = madvocConfig.getEncoding();

        if (encoding != null) {
          servletRequest.setCharacterEncoding(encoding);
          servletResponse.setCharacterEncoding(encoding);
        }

        characterEncodingSet = true;
      }

      // create action object
      Object action = createAction(actionConfig.actionClass);

      // create action request
      ActionRequest previousRequest = actionRequest;
      actionRequest = createActionRequest(actionPath, actionConfig, action, servletRequest, servletResponse);
      actionRequest.setPreviousActionRequest(previousRequest);

      // invoke and render
      if (actionConfig.isAsync()) {
        AsyncContext asyncContext = servletRequest.startAsync();
        executor.execute(new ActionRequestInvoker(asyncContext, actionRequest));
      } else {
        actionRequest.invoke();
      }
View Full Code Here

TOP

Related Classes of jodd.madvoc.ActionConfig

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.