Class ActionExtensionResolver

java.lang.Object
org.apache.struts2.dispatcher.mapper.ActionExtensionResolver

public class ActionExtensionResolver extends Object
Chooses the extension of a generated action URL from the extensions the target action accepts, so links, forms and redirects point at an extension the target can be reached by.
Since:
7.5.0
  • Constructor Details

    • ActionExtensionResolver

      public ActionExtensionResolver()
  • Method Details

    • setConfiguration

      public void setConfiguration(Configuration configuration)
      Parameters:
      configuration - the configuration used to look up the target action
      Since:
      7.5.0
    • setExtensions

      public void setExtensions(String extensions)
      Parameters:
      extensions - the global struts.action.extension list
      Since:
      7.5.0
    • setAllowDynamicMethodCalls

      public void setAllowDynamicMethodCalls(String enableDynamicMethodCalls)
      Parameters:
      enableDynamicMethodCalls - whether name!method names are split at their last !
      Since:
      7.5.0
    • applyTo

      public void applyTo(ActionMapping target)
      Sets the extension of target to the current request's extension when the target accepts it, otherwise to the target's first accepted extension. For a target declaring extensions an extensionless request counts as the empty extension; the first accepted extension is used when there is no current request, or for an extensionless request to an undeclared target, as in DefaultActionMapper.lookupExtension(String). Leaves target unchanged when it already has an extension, when no action in the configuration declares extensions, when the target action is unknown (a name reached only through the namespace's default-action-ref counts as unknown), or when neither the target nor the global constant declares extensions.
      Parameters:
      target - the mapping of the action the URL points at
      Since:
      7.5.0