1. web.xml configuration
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
2. struts.xml configuration
<constant name="struts.devMode" value="true" /><!-- The constant development mode treu will automatically update every time the action configuration is modified-->
<package name="default" namespace="/" extends="struts-default">
<action name="hello">
<result >
/index.jsp
</result>
</action>
</package>
3. Import the necessary jar package
find the directory
StrutsPrepareAndExecuteFilter
Right click, select properties, click External folder to find the source file in the local directory
Find the source file, that is, the directory where Struts is decompressed, such as: D:\struts-2.3.24.1\src\core\src\main\java directory, click ok, then you can see the source code of struts.
4. Configure API documentation
At the same time, right-click operation, there will be javadoc Location
javadoc URL find apidocs in browse vagrant local directory
The advantage at this time is that when you click on a class name, press F1, there will be official documents to see.
5. The configuration to write the xml file will automatically prompt
When writing the Struts.xml file with angle brackets and no text label prompt, you can search the catalog in the preferences menu in the window
Click Add, the Location is the directory of the struts.dtd file, the key type selects URI, and the key is the URL in the header of the Struts.xml file .
(1). URL acquisition:
(2).Struts.dtd acquisition: Go to the lib directory in the struts decompression directory to find a struts core.jar file and decompress it. There will be a struts.dtd file, which is what we need: