Actionmapping objects help to control the internal process of the framework. They can map request URIs to the action class and associate the action class with actionformbean.
Actionservlet uses these mappings internally and transfers controls to instances of specific action classes.
All action classes use the perform () method to implement specific application code and return an actionforward object, including the target resource name for response forwarding.
For example:
<Action-mappings>
<Action Path = "/createbook" type = "bookaction" name = "bookform" Scope = "request" input = "/createbook. jsp"> </Action>
<Forward name = "failure" Path = "/createbook. jsp"/>
<Forward name = "cancel" Path = "/index. jsp"/>
</Action-mappings>
Attribute description
Path relative path of the action class
Name: name of the Action bean associated with this operation
Full name of the action class connected to the ing of type (package name available)
Scope actionform bean scope (request or session)
Prefix is used to match the prefix of the request parameter and bean attribute.
Suffix is used to match the suffix of the request parameter and bean attribute.
Attribute scope name.
The default class of the fully qualified class of the classname actionmapping object is org. Apache. Struts. Action. actionmapping.
Path of the input form, pointing to the control that must be returned when an input error occurs in the bean
If unknown is set to true, the operation will be used as the default operation for all undefined actionmapping Uris.
If validate is set to true, actionservlet will call the validate () method of actionform bean to check the input before calling the perform () method on the Action object.
You can use the <forward> element to define the logical name of a resource, which is the target of the action class response to be forwarded.
Attribute description
ID
The fully qualified name of the classname actionforward class. The default name is org. Apache. Struts. Action. actionforward.
Name the logical name used by the operation class to access actionforward
Path: the path of the target resource to be forwarded.
If redirect is set to true, actionservlet uses the sendredirect () method to forward resources.