Merge pull request #7673 from kertpjatkin/master

[BAEL-2851] Debugging the Spring MVC 404 “No mapping found for HTTP request with URI...” error
This commit is contained in:
Eric Martin 2019-09-08 22:45:16 -05:00 committed by GitHub
commit 27b5ddfb38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package com.baeldung.spring.controller;
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
public class GreetingController {
@RequestMapping(value = "/greeting", method = RequestMethod.GET)
public String get(ModelMap model) {
model.addAttribute("message", "Hello, World!");
return "greeting";
}
}

View File

@ -0,0 +1,9 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Greeting</title>
</head>
<body>
<h2>${message}</h2>
</body>
</html>