Package org.apache.struts2
Class DefaultUnknownHandlerManager
java.lang.Object
org.apache.struts2.DefaultUnknownHandlerManager
- All Implemented Interfaces:
UnknownHandlerManager
Default implementation of UnknownHandlerManager
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
build()
Builds a list of UnknownHandlers in the order specified by the configured "unknown-handler-stack".handleUnknownAction
(String namespace, String actionName) Iterate over UnknownHandlers and return the result of the first one that can handle ithandleUnknownMethod
(Object action, String methodName) Iterate over UnknownHandlers and return the result of the first one that can handle it.handleUnknownResult
(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode) Iterate over UnknownHandlers and return the result of the first one that can handle itboolean
void
setContainer
(Container container)
-
Field Details
-
unknownHandlers
-
-
Constructor Details
-
DefaultUnknownHandlerManager
public DefaultUnknownHandlerManager()
-
-
Method Details
-
setContainer
-
build
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 interfaceUnknownHandlerManager
- Parameters:
actionContext
- the action contextactionName
- the action nameactionConfig
- the action configresultCode
- the result code
-
handleUnknownMethod
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 interfaceUnknownHandlerManager
- Parameters:
action
- the actionmethodName
- the method name- Returns:
- Result representing result of given action method
- Throws:
NoSuchMethodException
- if method con not be handled
-
handleUnknownAction
Iterate over UnknownHandlers and return the result of the first one that can handle it- Specified by:
handleUnknownAction
in interfaceUnknownHandlerManager
- Parameters:
namespace
- the namespaceactionName
- the action name
-
hasUnknownHandlers
public boolean hasUnknownHandlers()- Specified by:
hasUnknownHandlers
in interfaceUnknownHandlerManager
-
getUnknownHandlers
- Specified by:
getUnknownHandlers
in interfaceUnknownHandlerManager
-