I was attempting to make changes to my controller, and all of a sudden, I no longer seem to receive any requests (404 when attempting to hit the servlet mapped URLs). I'm sure I've broken my web.xml
or app-servlet.xml
, but I just don't see where. I can access index.jsp
from tomcat (http://IP/app/index.jsp
), but I can't get my servlet mapping to work correctly.
Help?
web.xml:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app version = "2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>app</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/myRequest</url-pattern>
</servet-mapping>
app-servlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id = "MyController" class = "com.stefankendall.MyController" ></bean>
<bean id="urlMappingDeployment" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/myRequest">MyController</prop>
</props>
</property>
</bean>
</beans>