我用的是struts-2.2.3,开始把所有的jar包都放进去了,但是一直报java
信息: Parsing configuration file [struts-plugin.xml]
2011-6-11 8:39:56 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Users/Jacky/Workspaces/MyEclipse%208.6/.metadata/.me_tcat/webapps/struts/WEB-INF/lib/struts2-gxp-plugin-2.2.3.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)web
头痛中,后来看到有人说:这是apache的失误。按照官方文档说明,运行Struts2必须加载5个核心jar包,也就是我们一开始拷贝的5个jar包,若是你用的是 Struts2以前的版本是没有问题的,可是若是去下载这个新版本,就会报如上错误,由于还须要加载另外两个jar包,但是官方的说明文档没有更新
因而照此方法加入了如下几个包
struts2-core-2.1.6.jar、
xwork-2.1.2.jar、
freemarker-2.3.13.jar、
ognl-2.6.11.jar、
commons-logging-1.0.4.jar、
commons-fileupload-1.2.1.jar、
commons-io-1.3.2.jar
但试事后仍是报错,具体错误不记得了。apache
不气馁,再找,发现又有人给了方法,此次成了:)app
将struts-2.1.6-all.zip中apps 文件夹中struts2-blank-2.1.6.war文件解压。进入struts2-blank-2.1.6"WEB-INF"lib,只将该文件夹下的9个jar包导入到项目工程中便可。
解压缩的方法用winRAR工具就能够。webapp
它说是9个jar包,我看到得是11个jar包,全弄进去OK了工具
包以下:
asm-3.1.jargoogle
asm-commons-3.1.jarspa
asm-tree-3.1.jarxml
commons-fileupload-1.2.2.jarip
commons-io-2.0.1.jar
commons-lang-2.5.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
ognl-3.0.1.jar
struts2-core-2.2.3.jar
xwork-core-2.2.3.jar
看来jar包加多了也不是好事呀,google不行就百度,百度不行再google,加油!