Problem When I run my project and try to run
ERROR Dispatcher Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.5/wtpwebapps/Struts2Test/WEB-INF/lib/struts2-gxp-plugin-2.5.22.jar!/struts-plugin.xml:27:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
and more...
http://localhost:8081/Struts2Test/testAction
It does not work. It show HTTP status 404(On my browser)
Eclipse Console
There are no errors on Eclipse Console
/Struts2Test/src/struts.xml
<?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="test" extends="struts-default">
<action name="testAction" class="test.Action.TestAction" method="execute">
<result name="success">
/success.jsp
</result>
<result name="error">
/error.jsp
</result>
</action>
</package>
</struts>
TestAction.java
package test.Action;
import com.opensymphony.xwork2.ActionSupport;
public class TestAction extends ActionSupport
{
public String execute()
{
return "success";
}
}
/Struts2Test/WebContent/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>Struts2Test</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

Hello World(in struts)
Create a dynamic web project in Eclipse Enterprise edition
Eclipse>File>New>Dynamic Web Project
Name it: HelloWorld
It should have web.xml file in Web content folder>WEB-INF>web.xml
Create a Class TestAction.java
(/HelloWorld/src/com/test/TestAction.java)
/HelloWorld/WebContent/success.jsp
/HelloWorld/src/struts.xml
Note: Your struts.xml file should be inside src folder of your dynamic web project. Otherwise it will not work.
Download essential jar files from struts site
You need to add these jar files in your Java Build Path
Select your Project>Right Click>Properties>Java Build Path>Add External Jar files
Now, You need to add these jar files in Deployment Assembly
Select your Project>Right Click>Properties>Deployment Assembly>Add>Click on Java Build Path>The jar files which you added earlier will be present there. Select and ok.
Run your project on Server
Select your project> Run as>Run on Server
On your browser
http://localhost:8081/HelloWorld/testAction
(I changed my port number from 8080 to 8081. Default port number for Tomcat is 8080. So the URL will http://localhost:8080/HelloWorld/testAction. )