Bin neu im Spring Boot.Jede Zeit, die ich meine Spring Boot-App ausführen, erhalte ich einen Fehler. Brauchen Sie Hilfe beim Ausführen meiner Spring Boot-Anwendung.Fehler beim Ausführen der Spring Boot-Anwendung
Fehlermeldung: Whitelabel Fehler Seite
Diese Anwendung hat keine explizite Zuordnung für/Fehler, so dass Sie diese als Ausweich sehen.
Mo Okt 10 10:39:54 WAT 2016 Es ist ein unerwarteter Fehler aufgetreten (Typ = Nicht gefunden, Status = 404). keine Nachricht vorhanden
Code:
package hello;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GreetingController {
@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
model.addAttribute("name", name);
return "greeting";
}
}
package com.HelloWorld;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}
}
- greeting.html
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="'Hello, ' + ${name} + '!'" />
</body>
</html>
Welche URL versuchen Sie zugreifen? –