Whitelabel Error Page

来源:互联网 发布:安卓底部导航栏源码 编辑:程序博客网 时间:2024/05/21 15:21

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Aug 09 11:02:44 CST 2017
There was an unexpected error (type=Not Found, status=404).
No message available

这里写图片描述

解析:404错误是由于访问路径不正确导致的。

源码查看:

package org.sang;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestController@SpringBootApplicationpublic class TestSpringbootApplication {   public static void main(String[] args) {      SpringApplication.run(TestSpringbootApplication.class, args);   }   @RequestMapping(value="/aaa",produces="text/plain;charset=UTF-8")   String sayHello(){      return "hello world";   }}

properties配置如下:

这里写图片描述

正确的访问形式: localhost:8081/helloboot/aaa

这里写图片描述

访问路径组织: localhost:server.port(8081)/server.context-path(/helloboot)/RequestMapping(value=”/aaa”,)