I found a lot of forums telling about the error I typed in subject and I did try every suggestion without success. I did include the servlet-api.jar from Tomcat7 lib folder to Java Build Path
In Eclipse I have:
src/main/java/tutorial/mvc/TestController.java
src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml
src/main/webapp/WEB-INF/web.xml
src/main/webapp/WEB-INF/jsp/view.jsp
1 - TestController.java package tutorial.mvc; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class TestController { @RequestMapping("/test") public String test(){ return "view"; } } 2 - mvc-dispatcher-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="tutorial.mvc" /> <mvc:annotation-driven /> <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> /web.xml/web.xml <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> </beans> 3 - web.xml <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Spring MVC Application</display-name> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> 4 - view.jsp hello word 5 - POM <project xmlns="http://maven.apache.org/POM/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>basic-web-app</groupId> <artifactId>basic-web-app</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>basic-web-app Maven Webapp</name> <url>http://maven.apache.org</url> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>4.0.6.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> </plugin> </plugins> </build> </project>
When I look at Problem window I see
Cannot change version of project facet Dynamic Web Module to 3.0. basic-web-app line 1 Maven Java EE Configuration Problem
Java compiler level does not match the version of the installed Java project facet. basic-web-app Unknown Faceted Project Problem (Java Version Mismatch)
One or more constraints have not been satisfied. basic-web-app line 1 Maven Java EE Configuration Problem
Project facet Java 1.8 is not supported by target runtime Apache Tomcat v7.0. basic-web-app Unknown Faceted Project Problem