Skip to content

Commit a9c2336

Browse files
committed
Use controller in Spring Boot sample
Issue gh-1647
1 parent 068ed8d commit a9c2336

File tree

1 file changed

+7
-8
lines changed
  • spring-session-samples/spring-session-sample-boot-hazelcast/src/main/java/sample/config

1 file changed

+7
-8
lines changed
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616

1717
package sample.config;
1818

19-
import org.springframework.context.annotation.Configuration;
20-
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
21-
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
19+
import org.springframework.stereotype.Controller;
20+
import org.springframework.web.bind.annotation.RequestMapping;
2221

23-
@Configuration
24-
public class WebMvcConfig implements WebMvcConfigurer {
22+
@Controller
23+
public class IndexController {
2524

26-
@Override
27-
public void addViewControllers(ViewControllerRegistry registry) {
28-
registry.addViewController("/").setViewName("index");
25+
@RequestMapping("/")
26+
public String index() {
27+
return "index";
2928
}
3029

3130
}

0 commit comments

Comments
 (0)