1:Cannot locate the chosen ObjectFactory implementation: spring
缺少jar包:struts2-spring-plugin-2.1.8.jar類找不着
2:Line: 209 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1
此錯誤原因是struts對spring的支援需要struts2-spring-plugin-2.1.8.jar 包,添加jar包之後需要在web.xml中添加對應的監聽spring監聽器和配置參數
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
3:Struts dispatcher cannot be found. This is usually caused by using Struts tags
web.xml中url-pattern的值必須是/*保證所有的請求都要經過struts的過濾器