unable to locate configuration files of the name struts-plugin.xml提示信息的解决办法

本文探讨了解决Struts2应用中出现unabletolocateconfigurationfilesofthenamestruts-plugin.xml信息的方法。通过添加struts2插件,如struts2-json-plugin-2.1.8.1.jar和json-lib-2.1.jar,可以消除这一提示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天手工写个struts2web例子,总是出现unable to locate configuration files of the name struts-plugin.xml的信息(不是错误,也不是敬告) ,看着很别扭,也搜了一下这方面的东西,不过没有找到确切的解决办法。

 

自己来试下,

 

lib目录下的jar包:

commons-fileupload-1.2.1.jar

commons-logging-1.0.4.jar

freemarker-2.3.15.jar

ognl-2.7.3.jar

struts2-core-2.1.8.1.jar

xwork-core-2.1.6.jar

 

然后点击startup.bat启动tomcat,这时会有

unable to locate configuration files of the name struts-plugin.xml

的信息。

 

分析下,从字面理解,struts-plugin.xml,不能定位名字为名字为struts-plugin.xml的文件。应该是给struts2的插件机制有关,现在要在lib下添加一个struts2的任意一个插件

添加两个jar包

struts2-json-plugin-2.1.8.1.jar

json-lib-2.1.jar

 

然后启动tomcat

现在看到,没有了

unable to locate configuration files of the name struts-plugin.xml

的信息。

 

由此可见。

信息unable to locate configuration files of the name struts-plugin.xml是struts2插件机制引起的,如果在struts2应用中没有添加任何插件的话,那么会出现该信息的提示,(其实这条提示后面有一个词:skip,直接跳过了)。反之,添加了struts2的任何一款插件,则不会有这个提示。

 

个人理解,欢迎拍砖。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值