Hola, estoy intentando hacer el típico hola mundo con Spring MVC, pero hace nada.
GestionTurnosJPA/WebContent/WEB_INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<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" >
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
GestionTurnosJPA/WebContent/WEB_INF/springapp-servlet.xml
<?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">
<!-- the application context definition for the springapp DispatcherServlet -->
<bean name="inicio.do" class="us.es.carg.springapp.web.InicioController"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
GestionTurnosJPA/us.es.carg.springapp.web.InicioController
package us.es.carg.springapp.web;
import java.io.IOException;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class InicioController implements Controller{
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
return new ModelAndView("inicio");
}
}
GestionTurnosJPA/WebContent/WEB_INF/jsp/inicio.jsp
<html>
<head>
<title>Pagina de inicio</title>
</head>
<body>
ESTA ES LA PAGINA DE INICIO
</body>
</html>
GestionTurnosJPA/WebContent/index.jsp
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body onLoad="location.href='inicio.do'">
</body>
</html>
El error que me lanza es :
El recurso requerido (/GestionTurnosJPA/WebContent/inicio.do) no está disponible.
¿Alguien sabe que le sucede?
Un saludo