Can somebody explain the role of the Action Mapper in Struts 2?
The role of ActionMapper
interface in Struts2 framework is to extract mapping from the request's URL.
When given an
HttpServletRequest
, theActionMapper
may returnnull
if no action invocation request matches, or it may return anActionMapping
class that describes an action invocation for the framework to try.
You can read more about this feature here.
Th first method returns a mapping to try, it doesn't guarantee that this action will be executed.
The ActionMapping
returned by the action mapper contains all necessary information to invoke an action if there's an action config corresponding to this mapping is available in runtime configuration.
Different implementation of this interface can be used to override the default behavior for mapping URLs to actions in Struts2.