01struts2-01 Introduction to Java Learning and environment construction

Source: Internet
Author: User

a ,Struts2 Introduction 1.Struts2 Overview

Struts2 is the MVC Open source framework that Apache releases. Note: It is just a presentation layer (MVC) framework.

2, The origin of Struts2

Struts1: A set of MVC Open source frameworks developed by Apache . It was very popular 2005 years ago.

Cons:Struts1 's core controller is a Servlet. As the number of users increases, the drawbacks begin to emerge.

    struts2: in There is a design-ahead framework xwork xwork1 and webwork2 struts2 apache Opensymphony the organization was developed. It contains the webwork2 core and struts some features and functions. In addition, and struts1 nothing.

Vi. Building Struts2 development environment 1. Download Struts2 Development Package

http://struts.apache.org

2. Development package Directory Structure

3, build the development environment 3.1, copy the necessary jar packages into the classpath

What jar packages are copied?

Find Struts2 's own example,struts-blank 's War package, in its \web-inf\lib full copy of the jar package under the directory .

3.2, setting up the Struts2 configuration file

At the top of Classpath(on the top-most build path), Create a configuration file with the default name of Struts.xml .

Attention:

1. The file name is case-sensitive.

2. Create a location.

3. This name allows for modification, but we generally do not change it.

3.3, configuring the controller

A. Configuration location: In Web . xml

b, configure what: struts2 has written a filter.

Conclusion:

One embodiment of STRUTS2 's excellence than struts1 is that it uses a more powerful filter as a controller.

3.4, verify success

Deploy the app, start Tomcat, and no error indicates a successful build.

01struts2-01 Introduction to Java Learning and environment construction

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.