Spring MVC http status 404-Fehler

Ich bekomme diese Fehlermeldung nach Eingabe von url
localhost:8080/HelloWeb

HTTP Status 404 - /HelloWeb

type Status report

message /HelloWeb

description The requested resource is not available.
Apache Tomcat/7.0.30

Ich bin nicht in der Lage, es zu lösen, bitte jemand helfen
hier sind meine Dateien, die erforderlich sind, um zu tun, führen Sie diese SPRING MVC hello-Programm

HelloController.java

package com.tutorialspoint;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping(method = RequestMethod.GET)
    public String printHello(ModelMap model) {
        model.addAttribute("message", "Hello Spring MVC Framework!");

        return "hello";
    }
}

Hallo.jsp

<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<head>
<title>Hello World</title>
</head>
<body>
   <h2>${message}</h2>
</body>
</html>

web.xml

<web-app id="WebApp_ID" 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">

   <display-name>Spring MVC Application</display-name>

   <servlet>
      <servlet-name>HelloWeb</servlet-name>
      <servlet-class>
         org.springframework.web.servlet.DispatcherServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>HelloWeb</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>

</web-app>

HelloWeb-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:context="http://www.springframework.org/schema/context"
   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-3.0.xsd
   http://www.springframework.org/schema/context 
   http://www.springframework.org/schema/context/spring-context-3.0.xsd">

   <context:component-scan base-package="com.tutorialspoint" />

   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/jsp/" />
      <property name="suffix" value=".jsp" />
   </bean>

</beans>

und hier ist mein Projekt-Hierarchie

HelloWeb

 src

   com.tutorialspoint

 WebContent

   jsp

     Hallo.jsp

   META-INF

     MANIFEST.MF

   WEB_INF

     lib

     HelloWeb-servlet.xml

     index.jsp

     web.xml

sorry, ich habe vergessen zu zählen, dass ich nach dieser Spring MVC Beispiel von

tutorialspoint.com/spring/spring_mvc_hello_world_example.htm

  • Ich bin auch immer die gleichen Fehler. Hast du die Lösung ?
  • Nein, ich nicht.
Schreibe einen Kommentar