I use Apache Tomcat 7 and it's ON - Spring 3 with all the libraries on the classpath (compile and runtime).
that's my web.xml file in /WEB-INF/web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcherServlet-context.xml</param-value>
</context-param>
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
That's my context file in WEB-INF/dispatcherServlet-context.xml:
<!-- Scans within the base package of the application for @Components to configure as beans -->
<context:component-scan base-package="controllers" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
the Tomcat error when i put http://localhost:8080/projectname/ in the browser is:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml];
nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml] ecc ecc ecc
note that the error concern the file dispatcherServlet-servlet.xml not the dispatcherServlet-context.xml (the one i use, created, and mapped)
Thank you all guys!