I recently migrated to `Spring boot`. I used `Spring MVC` before. When I go to a site after the application starts, this throws 404 page not found. The controller handles the request, but for some reason does not find the jsp page.

My `Application.java`:

```
package com.myapp.webapp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages = "com.myapp")
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

```

`application.properties`

```
# Spring MVC configuration
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp

spring.datasource.url=jdbc:mysql://us-cdbr-iron-east-05.cleardb.net/heroku_4663e71bc0d567a?reconnect=true
spring.datasource.username=bb1a6d3ce29ada
spring.datasource.password=******
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

#spring.datasource.url=jdbc:mysql://localhost:3306/socialnet?autoReconnect=true&useSSL=false
#spring.datasource.username=root
#spring.datasource.password=123

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=none

debug=true

```

And `controller` for example

```
package com.myapp.webapp;

//imports

@Controller
@SessionAttributes({"accountInSession", "base64Photo"})
public class MainController {

    private static final Logger logger = LoggerFactory.getLogger(MainController.class);

    @Autowired
    private AccountService accountService;

    @Autowired
    private AuthenticationTrustResolver authenticationTrustResolver;

    @RequestMapping(value = {"/login", "/"})
    public ModelAndView loginPage(@RequestParam(value = "error", required = false) String error,
                                  @RequestParam(value = "logout", required = false) String logout,
                                  @RequestParam(value = "noLogin", required = false) String noLogin) {

        ModelAndView modelAndView = new ModelAndView("/login");
        if (error != null) {
            modelAndView.addObject("error", "Incorrect mail and/or password");
            //modelAndView.setViewName("login");

        }
        if (logout != null) {
            modelAndView.addObject("msg", "You've been logged out successfully!");
            //modelAndView.setViewName("login");

        }
        if (noLogin != null) {
            modelAndView.addObject("error", "Please log in to view this page");
        }
        if (!isCurrentAuthenticationAnonymous()) {
            //modelAndView.setViewName("login");
            modelAndView.setViewName("redirect:/account");
            return modelAndView;
        }
        return modelAndView;
    }

    @RequestMapping("/test")
    public String test() {
        return "redirect:/registration";
    }
}

```

For example if I go to `http://localhost:8080/test` `controller` redirected me to `http://localhost:8080/registration`

I used a multi module maven project with models: `common`(for models), `dao`, `service` and `webapp`.

So controllers located in
`java/com/myapp/webapp/controllers`

Jsp pages located in

`src/main/webapp/WEB-INF/jsp`

And path to files:
`java/com/myapp/Application.java`

`src/main/resources/application.properties`

And structure of `wepapp` module
[![poject](https://i.stack.imgur.com/1dWVQ.png)](https://i.stack.imgur.com/1dWVQ.png)