private static void registerInput(final ActionMapping actionMapping, String input) {
   if (isSimplePageFile(input)) {
     PartialTileDefinition tileDefinition = new PartialTileDefinition(input);
     FenixDefinitionsFactory.registerDefinition(tileDefinition);
     actionMapping.setInput(tileDefinition.getName());
   } else {
     // The input is using an existing tile definition
     actionMapping.setInput(input);
   }
 }
 private static void registerForward(
     final ActionMapping actionMapping,
     final Forward forward,
     Forwards forwards,
     Mapping mapping,
     String defaultResourcesName) {
   if (forward.useTile() && isSimplePageFile(forward.path())) {
     PartialTileDefinition tileDefinition =
         new PartialTileDefinition(forward, forwards, mapping, defaultResourcesName);
     FenixDefinitionsFactory.registerDefinition(tileDefinition);
     actionMapping.addForwardConfig(
         new ActionForward(
             forward.name(),
             tileDefinition.getName(),
             forward.redirect(),
             forward.contextRelative()));
   } else {
     // The forward is using an existing tile definition
     actionMapping.addForwardConfig(
         new ActionForward(
             forward.name(), forward.path(), forward.redirect(), forward.contextRelative()));
   }
 }
  @Override
  public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {

    if (!initialized) {
      loadActionsFromFile(actionClasses);
      PartialTileDefinition.init();
      initialized = true;
    }

    final String modulePrefix = StringUtils.removeStart(config.getPrefix(), "/");

    for (Class<?> actionClass : actionClasses) {
      Mapping mapping = actionClass.getAnnotation(Mapping.class);
      if (mapping == null || !modulePrefix.equals(mapping.module())) {
        continue;
      }

      final ActionMapping actionMapping = createCustomActionMapping(mapping);
      if (actionMapping == null) {
        continue;
      }

      actionMapping.setPath(mapping.path());
      actionMapping.setType(actionClass.getName());
      actionMapping.setScope(mapping.scope());
      actionMapping.setParameter(mapping.parameter());
      actionMapping.setValidate(mapping.validate());

      if (mapping.formBeanClass() != ActionForm.class) {
        final String formName = mapping.formBeanClass().getName();
        createFormBeanConfigIfNecessary(config, mapping, formName);
        actionMapping.setName(formName);
      } else if (!mapping.formBean().isEmpty()) {
        actionMapping.setName(mapping.formBean());
      }

      if (mapping.input().isEmpty()) {
        actionMapping.setInput(findInputMethod(actionClass, mapping));
      } else {
        registerInput(actionMapping, mapping.input());
      }

      String defaultResourcesName = getDefaultResourcesName(config);
      Forwards forwards = actionClass.getAnnotation(Forwards.class);
      if (forwards != null) {
        for (final Forward forward : forwards.value()) {
          registerForward(actionMapping, forward, forwards, mapping, defaultResourcesName);
        }
      }
      registerSuperclassForwards(
          actionMapping, actionClass.getSuperclass(), mapping, defaultResourcesName);

      Exceptions exceptions = actionClass.getAnnotation(Exceptions.class);
      if (exceptions != null) {
        registerExceptionHandling(actionMapping, exceptions);
      }

      initializeActionMappingProperties(actionMapping, mapping.customMappingProperties());

      config.addActionConfig(actionMapping);
    }
  }