Hi, I'm new to using Spring, so this is probably something really silly I'm missing. I've been bashing my head though, so hopefully you can point out the problem for me.
I've been following tutorials to make a simple Hello World app. However, my requests to hello.html are not being forwarded to my HelloController. Instead, I just get an error that says the servlet springapp is not available. The catalina log files look fine to me though.
Any help is appreciated. Thanks!
web.xml:
springapp-servlet.xmlCode:<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/sml/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"> <servlet> <servlet-name>springapp</servlet-name> <servlet-class>org.springframework.web.servlet.DispatchServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springapp</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file> index.jsp </welcome-file> </welcome-file-list> </web-app>
catalina.out snippet:Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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-2.5.xsd"> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/hello.html">hello</prop> </props> </property> </bean> <bean id="hello" class="springapp.web.HelloController"/> </beans>
Code:Mar 21, 2008 3:48:20 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive springapp.war Mar 21, 2008 3:51:01 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/springapp] Mar 21, 2008 3:51:01 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive springapp.war Mar 21, 2008 3:53:12 PM org.apache.catalina.core.StandardContext reload INFO: Reloading this Context has started


Reply With Quote
