Package org.apache.struts2
Interface UnknownHandler
public interface UnknownHandler
Handles cases when the result or action is unknown.
This allows other classes like Struts plugins to provide intelligent defaults easier.
-
Method Summary
Modifier and TypeMethodDescriptionhandleUnknownAction
(String namespace, String actionName) Handles the case when an action configuration is unknown.handleUnknownActionMethod
(Object action, String methodName) Handles the case when an action method cannot be found.handleUnknownResult
(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode) Handles the case when a result cannot be found for an action and result code.
-
Method Details
-
handleUnknownAction
Handles the case when an action configuration is unknown. Implementations can return a new ActionConfig to be used to process the request.- Parameters:
namespace
- The namespaceactionName
- The action name- Returns:
- An generated ActionConfig, can return null
- Throws:
StrutsException
- in case of errors
-
handleUnknownResult
Result handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode) throws StrutsException Handles the case when a result cannot be found for an action and result code.- Parameters:
actionContext
- The action contextactionName
- The action nameactionConfig
- The action configresultCode
- The returned result code- Returns:
- A result to be executed, can return null
- Throws:
StrutsException
- in case of errors
-
handleUnknownActionMethod
Handles the case when an action method cannot be found. This method is responsible both for finding the method and executing it.- Parameters:
action
- The action objectmethodName
- The method name to call- Returns:
- The result returned from invoking the action method, can return null if this instance cannot handle such methodName to allow other handlers give a chance
- Since:
- 2.1
-