1. Create a Web project

2. Introduce the Struts JAR

Download Strtus2, unpack it, usually don’t know which packages to refer to, if you import all the packages in lib, there are too many, go to apps, unpack the jar package

3. Introduce filters in web.xml

4. Configure struts2 configuration file (create struts.xml in SRC directory)

Create action(action is a POJO class)

Create the Action class and write the execute() method

5.2. Configure action and return result set in Struts.xml

6. Create hello.jsp file

In strusts.xml, define that when the action returns a result of “success”, skip to hello.jsp

7. Start the server

8. Problems arise

The project was not loaded into the server

The web. XML file is in the web-INF directory

Successful show