【发布时间】:2019-08-19 08:06:46
【问题描述】:
我已经为带有 rest 控制器的 springboot 编写了一个简单的代码。它运行良好,但没有到达终点。
我的应用程序类:
@SpringBootApplication
public class SpringbootRestTemplateDemo {
public static void main(String[] args) {
SpringApplication.run(SpringbootRestTemplateDemo.class, args);
System.out.println("Springboot Rest template demo");
}
}
我的控制器类:
@RestController
public class ProductController {
@RequestMapping(value="/product/details", method=RequestMethod.GET)
public String getProduct() {
return "Product details";
}
}
我希望使用 get 请求得到一个简单的消息,但它没有到达端点。 输入: http://localhost:8080/product/details
输出:
Whitelabel 错误页面 此应用程序没有明确的映射 /error,因此您将其视为后备。
2019 年 3 月 28 日星期四 19:34:44 IST 出现意外错误(type=Not 找到,状态=404)。没有可用的消息
【问题讨论】: