在web.xml中加入 这样系统会自动读取/WEB-INF/applicationContext.xml 如果自己定义文件名,还需要增加 此时的applicationContext.xml在src目录下