I think the first example on the official struts2 website is not very good,
Put all the jar packages of struts2 under Web-INF/lib, and the result is always incorrect.
The following two errors are returned:
-------------------------------------------------------------------
Unable to load Bean: Type: COM. opensymphony. xwork2.objectfactory class: Org. apache. struts2.spring. strutsspringobjectfactory-bean-jar: file:/D:/workspace /. metadata /. plugins/org. eclipse. WST. server. core/tmp0/wtpwebapps/teststruts/WEB-INF/lib/struts2-spring-plugin-2.0.6.jar! /Struts-plugin.xml: 8: 132
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. Register (xmlconfigurationprovider. Java: 208)
At org. Apache. struts2.config. strutsxmlconfigurationprovider. Register (strutsxmlconfigurationprovider. Java: 101)
Caused by: Java. Lang. noclassdeffounderror: ORG/springframework/Context/applicationcontextaware
---------------------------------------------------------------------
I checked it several times in other places, but an error occurred when I ran tomcat. I found it for half a day because it turned out to be
Don't see the following http://struts.apache.org/2.x/docs/simple-setup.html
If any struts 2 plugins are encoded, then other jars may be needed too. For example, the optional spring plugin requires the spring jars to be present.
This is too demanding for beginners. If you don't know what spring is, don't use struts2.
Remove those jar packages, (simple, leave xwork-2.0.4.jar, commons-logging-1.0.4.jar, freemarker-2.3.8.jar, ognl-2.6.11.jar, struts2-core-2.0.11.jar) can run.