JavaEar 专注于收集分享传播有价值的技术资料

Spring Boot "No message available" error(status = 404),

I'm using Spring Boot with embeded Tomcat. When it starts it logs into console:

s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/home]}" onto public java.lang.String

So I guess the URL is mapped to the controller. But http://localhost:8090/home gives me an error 404.

There was an unexpected error (type=Not Found, status=404). No message available

public class Application extends SpringBootServletInitializer {
    public static void main(final String[] args) {, args);
    //overrides the configure() method to point to itself, so Spring can find the main configuration.
    protected final SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
        return application.sources(Application.class);
    public ViewResolver getViewResolver() {
        final TilesViewResolver resolver = new TilesViewResolver();
        return resolver;
    public TilesConfigurer getTilesConfigurer() {
        final TilesConfigurer configurer = new TilesConfigurer();
        return configurer;

public class SampleController {
    @RequestMapping (value = "/home")
    public String helloWorld(Model model) {
        model.addAttribute("pageTitle", "home");
        return "base";


    <definition name="base" template="/WEB-INF/tiles/basic/basic-template.jsp">
        <put-attribute name="head" value="/WEB-INF/tiles/basic/head.jsp" />

My project structure


  1. You're returning 'home' from your controller method, but I don't see a home.jsp on your project structure.

  2. 参考答案2