用spring和web整合时加载页面出现报错The server encountered an internal error that prevented it from fulfilling thi

用spring和web整合时加载页面出现报错,如图下所示:

用spring和web整合时加载页面出现报错The server encountered an internal error that prevented it from fulfilling thi

打开Tomcat启动日志看看发现提示如图:

用spring和web整合时加载页面出现报错The server encountered an internal error that prevented it from fulfilling thi

就是说tomcat服务器没有加载到spring.XML配置文件

仔细查找了一下原因,原来我的web.xml文件放在了WebContent的目录下,所以没有加载得到web.xml,这样当然也没有加载得到spring.xml

用spring和web整合时加载页面出现报错The server encountered an internal error that prevented it from fulfilling thi

把web.xml重新放回到WEB-INF目录下重启tomcat服务器就可以了

用spring和web整合时加载页面出现报错The server encountered an internal error that prevented it from fulfilling thi

虽然不是什么大问题但这些小细节还是要注意一下