I have a Spring-Boot app that seems to be out of the norm. This is Spring-MVC, but I do not want to use speed, thimeleaf or anything else. Ideally, I would just use HTML. Then I use jQuery to make my AJAX calls to my REST services, and then populate the pages with returned JSON. The only way I can basically get this to work is to put my html under /src/resources/templates and then have @Controller for each page. Therefore, I have:
@SpringBootApplication
public class Application { public static void main(String[] args) throws Throwable { SpringApplication.run( Application.class, args ); } }
and my controllers
@Controller public class HomeController { @RequestMapping("/") public String getHome() { return "index" }
and
@Controller public class AboutController { @RequestMapping("/about") public String getAbout() { return "about" }
I looked through Spring manuals and sample projects, but I don't see how to set it up. I use startup projects to get Spring-mvc and security, but otherwise I donβt see what I need to do, so go to:
localhost / home or localhost / about or localhost / customer
Or do I need to have @Controller for each page?
spring-boot spring-mvc
sonoerin
source share