Download the jar package

Website:Struts.apache.org/download.cg…

After downloading the jar package in the base dependency lib, there are eight files in total.

Step one

Step 2

Click step 5 to find the path of the lib file you just downloaded.

struts.xml

<? The XML version = "1.0" encoding = "utf-8"? > <! DOCTYPE Struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN "Http://struts.apache.org/dtds/struts-2.5.dtd" > < struts > < package name = "Hello" extends = "struts - the default" > < action name="Hello"> <result> HelloWorld.jsp </result> </action> </package> </struts>Copy the code

Modify the web. The XML

2.5.* Version package name changed

Will default to:

<filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class>
Copy the code

To:

<filter-class> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter </filter-class>
Copy the code

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — line — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — – — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — line — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — – — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — line — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –

The following are the problems that occurred when I made my own Demo:

Struts-default becomes red

Error Cannot resolve Struts Package 'struts-default'.validates struts. XML files for syntactic and reference errors, The cause is a struts-default reference errorCopy the code

So solved!