Configuration File: Configure actionmapping

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.