web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spitter-servlet.xml</param-value>
</context-param>
<servlet>
<servlet-name>spitter</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spitter</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
spitter-servlet.xml
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/home=homeController
</value>
</property>
</bean>
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="order" value="1"></property>
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<bean name="homeController" class="org.SpringMvcExample.homeController"></bean>
homeController.java
public class homeController {
@RequestMapping( { "/", "/home" })
public String showHomePage(Map<String, Object> model) {
System.out.println("I am here");
model.put("spittles", new String("This is ramesh"));
return "home";
}
}
Why i am not able to see the home.jsp??
home.jsp is placed in the path:WEB-INF/jsp/home.jsp
I am entering the url as http://localhost:8080/SpringMvcExample/home.jsp
and the error is : resource not found.
Whats wrong here??
Please help me..
Thanks in Advance