Struts2 Learning Basics Note 2

Source: Internet
Author: User

Basic configuration of 6.5 Struts2

1web.xml

function: Load Core filter

Format: <filter>

```````

</filter>

<filter-mapping>

<filter-name> Filter Name </filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

2 Drfault Properties

Function: Set the default value of the main office property

3 struts.properties

Function: Change the default value of the main office property

Location: src Directory

4 Struts-default.xml

Function: Sets the default value of the corresponding tag attribute in the Struts.xml file and the introduction of the default Interceptor

5 struts.xml Core Configuration tag

Format <struts>

<include file= " the file that was introduced " />

<constau name="Main Office Property name"value="value"/>

<packahe name="Package Name"extends="Inherited Packages"[namespace="name Space"]>

<action name="Object name/Access format"class="class full Name"[method]="Execute"Requested method >

<result name="identify the results after processing"[Type="DispeTcher/redirect/chain/redirectaction"]>

Invoke action dynamically

Using action to access the format

Format Xxaction!methodname.action

Note Modify Struts.enable.DynamicMethodInvacation =true

With wildcard characters

< /span> Span style= "Mso-spacerun: ' Yes '; font-size:9.0000pt; font-family: ' Wingdings '; ">à à   represents any content

< /span>       {0}  à à   represents the contents of all" * "&NBSP;&NBSP;&NBSP;&NBSP;{1}~{9}&NBSP; à à   represents the use of the first to Nineth wildcard character

Action Processing result-result

1) R esult Tag Format

Name: matches the return value within a method in the action

Type:dispatcher/redirect/chain/redirectaction

Note: If the request resource is action, the format is ActionName

2) use a wildcard character

Struts2 Learning Basics Note 2

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.