I am using pre setup Maven project from openshift and when I`m running the app on Tomcat the answer is "HTTP Status 404 - /WEB-INF/views/hello.jsp" Here is the web.xml
<display-name>Spring MVC Application</display-name>
<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/dispatcher-servlet.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>
dispatcher-servlet
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
hello.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title></title>
</head>
<body>
<h1>Message : ${message}</h1>
</body>
</html>
and controller
@Controller
@RequestMapping("/welcome")
public class Test {
@RequestMapping(method = RequestMethod.GET)
public String printWelcome(ModelMap model) {
model.addAttribute("message", "Spring 3 MVC - Hello World");
return "hello";
}
}
My IDEA Spring service shows that it is not able to resolve "hello" in "return "hello";" and there is no error in log just shows "HTTP Status 404 - /WEB-INF/views/hello.jsp" when i ask for http://localhost:9999/welcome; Appreciate everyone`s answer
PS here is the source code if anyone is interested, thanks