Class DefaultUnknownHandlerManager

java.lang.Object
org.apache.struts2.DefaultUnknownHandlerManager
All Implemented Interfaces:
UnknownHandlerManager

public class DefaultUnknownHandlerManager extends Object implements UnknownHandlerManager
Default implementation of UnknownHandlerManager
See Also:
  • Field Details

  • Constructor Details

    • DefaultUnknownHandlerManager

      public DefaultUnknownHandlerManager()
  • Method Details

    • setContainer

      public void setContainer(Container container)
    • build

      protected void build() throws Exception
      Builds a list of UnknownHandlers in the order specified by the configured "unknown-handler-stack". If "unknown-handler-stack" was not configured, all UnknownHandlers will be returned, in no specific order
      Throws:
      Exception - in case of any error
    • handleUnknownResult

      public Result handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode)
      Iterate over UnknownHandlers and return the result of the first one that can handle it
      Specified by:
      handleUnknownResult in interface UnknownHandlerManager
      Parameters:
      actionContext - the action context
      actionName - the action name
      actionConfig - the action config
      resultCode - the result code
    • handleUnknownMethod

      public Object handleUnknownMethod(Object action, String methodName) throws NoSuchMethodException
      Iterate over UnknownHandlers and return the result of the first one that can handle it. Must throw an exception if method cannot be handled.
      Specified by:
      handleUnknownMethod in interface UnknownHandlerManager
      Parameters:
      action - the action
      methodName - the method name
      Returns:
      Result representing result of given action method
      Throws:
      NoSuchMethodException - if method con not be handled
    • handleUnknownAction

      public ActionConfig handleUnknownAction(String namespace, String actionName)
      Iterate over UnknownHandlers and return the result of the first one that can handle it
      Specified by:
      handleUnknownAction in interface UnknownHandlerManager
      Parameters:
      namespace - the namespace
      actionName - the action name
    • hasUnknownHandlers

      public boolean hasUnknownHandlers()
      Specified by:
      hasUnknownHandlers in interface UnknownHandlerManager
    • getUnknownHandlers

      public List<UnknownHandler> getUnknownHandlers()
      Specified by:
      getUnknownHandlers in interface UnknownHandlerManager