---
title: "Could not open ServletContext resource [/WEB-INF/Dispatcher-servlet.xml]"
author: "wangxr_it"
date: "2012-06-07T16:58:07Z"
tags: ["DispatcherServlet", "Servlet", "SpringMVC", "org", "springframework"]
categories: ["开源软件"]
slug: "could-not-open-servletcontext-resource-web-inf-dispatcher-servlet-xml"
draft: false
lastmod: "2012-06-07T17:00:11Z"
id: 1554599
url: "https://wangxr66.iteye.com/blog/1554599"
---

在应用SpringMvc时候，不注意常常会出现上述异常，原因：默认的DispatcherServlet在初始化时候会加载Dispatcher-servlet.xml文件，所以如果名字或者路径发生了变化，需要在web.xml中配置，形如： Dispatcher org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/classes/\*applicationContext\*.xml Dispatcher \*.action