Struts 1.3 Learning

Source: Internet
Author: User

Struts 1.3.8 has been around for a long time. However, due to the deep-rooted nature of struts1.2, struts2.0 is very popular, so it is unlikely that struts is already a "Sunset technology.

However, it is necessary to understand struts's "mass basis.

1. Improvement

1.1 The jar package is divided into several files

This has little impact on the original program, if it is upgraded. The following packages are necessary:
Commons-chain-1.1.jar (one of the main improvements)
Struts-core-1.3.8.jar (this pack must be)
Struts-extras-1.3.8.jar (some practical actions, usually used)
Struts-taglib-1.3.8.jar (labels are basically used)

1.2 Support for building Maven 2

Needless to say

1.3 move action to "struts chain" request processor

I am not very familiar with the major changes. If you are interested, please take a look.

1.4 enhanced configuration and support for extends and tiles

Tiles is rarely used.

The addition of extends is a good improvement. Many frameworks have this configuration section, such as struts2 and ibatis. It is easy to use and can reduce the configuration.

 

2. view the changes of struts1.3 from the DTD file

Most of struts's work comes from configuration, and version upgrades can be seen from the DTD file.

Http://struts.apache.org/dtds/struts-config_1_3.dtd
Http://struts.apache.org/dtds/struts-config_1_2.dtd

One of the biggest improvements in 2.1, version number changes1.2 to 1.3. This is nonsense.

2.2 Data-sources configuration Removal
Almost all frameworks have data source configurations. With Spring, this configuration is of course for spring. It is good to remove it, saving dozens of pages of useless text in struts books.

2.3 add extends
This attribute is available in many configuration sections of the configuration file. Of course, the most useful section is the form-bean configuration section. Good stuff.

2.4 enhancedReserved for future use
Station seat first.

2.5 reset attribute of form-PropertyEasy to view by yourself
Reset the flag that indicates when this property shocould be reset
To its "initial" value when the form's "RESET ()" method is
Called. If this is set to "true", the property is always
Reset when "RESET ()" is called. This can also be set
One or more HTTP methods, such as get or post. In such
Case, the property will be reset only when the HTTP Method
Used for the request being processed is already ded in this
Attribute's value (s). Multiple HTTP methods can be
Specified by separating them with whitespace or commas.

2.6 other configuration attributes related to common chain
Catalog the name of a commons-chain catalog in which to look up
A command to be executed as part of servicing this request.
Only meaningful if "command" is also specified.

Command the name of a commons-chain command which shocould be looked up
And executed as part of servicing this request.

Cancellable set to "true" if the action can be canceled. By default,
When an action is canceled, validation is bypassed
And the action shoshould not execute the business operation.
If a request tries to cancel an action when cancellable
Is not set, a "invalidcancelexception" is thrown.
[False]

And so on.

3. Summary
Struts, as a veteran framework, will not "suddenly die". Learning and upgrading are still necessary.

Better learning resources include:
The http://struts.apache.org download package contains English documents

Http://wiki.springside.org.cn/display/springside/PragmaticStruts
Springside has a lot of good articles. Unfortunately, the authors are masters and many things have been around, but they are all classic.

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.