I'm having a weird problem trying to integrate Spring MVC and Maven into a Google AppEngine web application.
This is my web.xml
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/webmvc-config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
this is my springmvc config file
<context:annotation-config />
<context:component-scan base-package="com.mypackage" />
<mvc:annotation-driven/>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/view/"
p:suffix=".jsp"
p:viewClass="org.springframework.web.servlet.view.JstlView" />
this is my controller:
@Controller
@RequestMapping(value = "/hello")
public class HelloController {
@RequestMapping(method = RequestMethod.GET)
public String helloGet(ModelMap map) {
map.put("name", "seb!");
return "hello";
}
}
and this is my view located in webapp / WEB-INF / jsp / view / hello.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello Controller</title>
</head>
<body>
<h1>Hello ${name}!</h1>
</body>
</html>
and this my pom contains dependencies on SpringMVC 3.0.3, servlet-api 2.5, jstl 1.2
I keep getting
WARNING: No mapping found for HTTP request with URI [/WEB-INF/jsp/view/hello.jsp] in DispatcherServlet with name 'dispatcher'
when i hit localhost: 8080 / hello and i cant figure out why. Is it because of GAE or am I missing something in some configuration?
Update : If I send the URL from / app / * to Spring Dispatcher, changing my web.xml as follows:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>`
it will work, but I just want to use the landing pages and use the application root