This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table employee ( | |
emp_no int (10), | |
name varchar(100), | |
primary key (emp_no) | |
); | |
insert employee values (1, 'user1'); | |
insert employee values (2, 'user2'); | |
insert employee values (3, 'user3'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table employee ( | |
emp_no int (10), | |
name varchar(100), | |
primary key (emp_no) | |
); | |
insert employee values (1, 'user1'); | |
insert employee values (2, 'user2'); | |
insert employee values (3, 'user3'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Order(0) | |
@RestControllerAdvice(annotations = RestController.class) | |
public class GlobalRestControllerAdvice { | |
@ExceptionHandler(Exception.class) | |
public Map<String, Object> handleException(Exception e){ | |
Map<String, Object> errorMap = new HashMap<>(); | |
errorMap.put("code", "E001"); | |
errorMap.put("message", "에러 발생했어요"); | |
return errorMap; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping | |
public class BackController { | |
@GetMapping("/index-rest") | |
public ResponseEntity idx(){ | |
throw new RuntimeException(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ControllerAdvice | |
public class GlobalControllerAdvice { | |
@ExceptionHandler(Exception.class) | |
public String handleException(Exception e){ | |
return "error"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@RequestMapping | |
public class FrontController { | |
@GetMapping("/index") | |
public String idx(){ | |
throw new RuntimeException(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@RequestMapping | |
public class FrontController { | |
@GetMapping("/index") | |
public String idx(){ | |
throw new RuntimeException(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String ...args){ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HELP.md | |
target/ | |
!.mvn/wrapper/maven-wrapper.jar | |
!**/src/main/** | |
!**/src/test/** | |
### STS ### | |
.apt_generated | |
.classpath | |
.factorypath |