Files
spring-boot-rest/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/controllers/MainController.java
Binod Pant 896a2d071a PR for http://jira.baeldung.com/browse/BAEL-1947 Spring Boot Vue (#4687)
* commit first as binodpanta

* revert test change

* A short example of real-time event streaming using Spring WebFlux

* Code for http://jira.baeldung.com/browse/BAEL-1527

* remove unrelated files

* Apply feedback changes to rename test and remove link from readme file, ongoing work

* Update formatting fixes to code and add pom changes, that partially fix test runnning issues in IDE but not in cmdline

* Apply Eclipse formatter to test code and apply suggested pom fixes

* BAEL-1527 Formatting fix in pom.xml

* Use string.format to cleanup logging code

* BAEL-1527 Changed logging pattern

* Start the spring-boot-vue module, WIP

* some small updates with comments

* Add index html template page

* merge pom.xml fixes

* Add integration test with MockMvc to verify index.html content is rendered correctly

* fix up pom merge issues

* merge issues fix for pom

* pom end of file newline
2018-07-23 23:00:30 +02:00

19 lines
645 B
Java

package com.baeldung.springbootmvc.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class MainController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) {
// this attribute will be available in the view index.html as a thymeleaf variable
model.addAttribute("eventName", "FIFA 2018");
// this just means render index.html from static/ area
return "index";
}
}