Package jodd.madvoc

Examples of jodd.madvoc.MadvocException


    ServletContext servletContext = actionRequest.getHttpServletRequest().getServletContext();

    String jspPath = servletContext.getRealPath(target);

    if (jspPath == null) {
      throw new MadvocException("Real path not found: " + target);
    }
    File jspFile = new File(jspPath);
    File targetFile = new File(convertToNewName(jspPath));

    target = convertToNewName(target);
View Full Code Here


        resultType = madvocConfig.getDefaultResultType();
      }

      actionResult = resultsManager.lookup(resultType);
      if (actionResult == null) {
        throw new MadvocException("Action result not found: " + resultType);
      }

      // convert remaining of the string to result object
      try {
        Class targetClass = actionResult.getResultValueType();
View Full Code Here

   */
  protected Object createAction(Class actionClass) {
    try {
      return actionClass.newInstance();
    } catch (Exception ex) {
      throw new MadvocException("Invalid Madvoc action", ex);
    }
  }
View Full Code Here

    elapsed = System.currentTimeMillis();

    try {
      scanPaths(classpath);
    } catch (Exception ex) {
      throw new MadvocException("Scan classpath error", ex);
    }
    elapsed = System.currentTimeMillis() - elapsed;
    log.info("Madvoc configured in " + elapsed + " ms. Total actions: " + actionsManager.getActionsCount());
  }
View Full Code Here

    String entryName = entryData.getName();
    if (entryName.endsWith(actionClassSuffix) == true) {
      try {
        onActionClass(entryName);
      } catch (ClassNotFoundException cnfex) {
        throw new MadvocException("Invalid Madvoc action class: " + entryName, cnfex);
      }
    } else if (entryName.endsWith(resultClassSuffix) == true) {
      try {
        onResultClass(entryName);
      } catch (ClassNotFoundException cnfex) {
        throw new MadvocException("Invalid Madvoc result class: " + entryName, cnfex);
      }
    }
  }
View Full Code Here

        if (defaultWrappers != null) {
          int ndx = i;
          for (Class<? extends T> defaultWrapper : defaultWrappers) {
            // can't add default list stack to default list
            if (defaultWrapper.equals(getDefaultWebAppWrapper())) {
              throw new MadvocException("Default wrapper list is self-contained (cyclic dependency)!");
            }
            list.add(ndx, defaultWrapper);
            ndx++;
          }
        }
View Full Code Here

   */
  protected <R extends T> R createWrapper(Class<R> wrapperClass) {
    try {
        return wrapperClass.newInstance();
    } catch (Exception ex) {
      throw new MadvocException("Invalid Madvoc wrapper: " + wrapperClass, ex);
    }
  }
View Full Code Here

   */
  protected PathMacros createPathMacro() {
    try {
      return madvocConfig.getPathMacroClass().newInstance();
    } catch (Exception ex) {
      throw new MadvocException("PathMacro class error", ex);
    }
  }
View Full Code Here

   * Resolves action method for given string ane method name.
   */
  public Method resolveActionMethod(Class<?> actionClass, String methodName) {
    MethodDescriptor methodDescriptor = ClassIntrospector.lookup(actionClass).getMethodDescriptor(methodName, false);
    if (methodDescriptor == null) {
      throw new MadvocException("Action class '" + actionClass.getSimpleName() + "' doesn't have public method: " + methodName);
    }
    return methodDescriptor.getMethod();
  }
View Full Code Here

   * Registers action with provided action signature.
   */
  public ActionConfig register(String actionSignature, String actionPath) {
    int ndx = actionSignature.indexOf('#');
    if (ndx == -1) {
      throw new MadvocException("Madvoc action signature syntax error: " + actionSignature);
    }
    String actionClassName = actionSignature.substring(0, ndx);
    String actionMethodName = actionSignature.substring(ndx + 1);
    Class actionClass;
    try {
      actionClass = ClassLoaderUtil.loadClass(actionClassName);
    } catch (ClassNotFoundException cnfex) {
      throw new MadvocException("Madvoc action class not found: " + actionClassName, cnfex);
    }
    return register(actionClass, actionMethodName, actionPath);
  }
View Full Code Here

TOP

Related Classes of jodd.madvoc.MadvocException

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.