Blame view

src/main/java/daeucna/config/handler/RootController.java 572 Bytes
2034b5b1   함상기   Init Version 2024...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  package daeucna.config.handler;

  

  import org.springframework.boot.web.servlet.error.ErrorController;

  import org.springframework.stereotype.Controller;

  import org.springframework.web.bind.annotation.GetMapping;

  

  @Controller

  public class RootController implements ErrorController {

      // url 직접 접근할 경우 대체 경로 추가

      private final String ERROR_PATH = "/error";

  

      @GetMapping(ERROR_PATH)

      public String redirectRoot(){

          return "forward:/index.html";

      }

  

      public String getErrorPath(){

          return null;

      }

  }