N
N
Nevars2016-11-12 11:40:29
Spring
Nevars, 2016-11-12 11:40:29

Why can't Spring Boot see html?

Downloaded from https://start.spring.io/ project from Web, JPA. I deploy on my computer. Next, I throw the index.html file into the src/main/resources/static folder. I start the project - the page is displayed. Now, I am adding a controller

package ru.nevars.bunny.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/page-login")
public class LoginController {

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public ModelAndView loadLoginPage() {
        return new ModelAndView("page-login");
    }
}

And I throw page-login.html into the static folder. When launching a varnik on a tomcat, the following error is thrown

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sat Nov 12 11:38:15 MSK 2016
There was an unexpected error (type=Not Found, status=404).
no message available

How is this problem treated in Spring Boot?
PS I tried to add a custom path to the static folder in application.properties. I also tried to put the html of the page in another folder and set the path to it in the spring properties.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question