2021-06-25 TIL

3577 단어 TILTIL

fact

feeling

  • 애플케이션의 로그 설정, Nginx 로그 설정 등 모니터링 설정을 해보았다. 모르는게 너무 많다. 한편으로는 서버 장애가 발생했을때 이렇게 미리
    대비해두면 대처하기 좋을 것같다. 실마리가 있고 없고의 차이는 크기 때문이다.

Findings

@RequestMapping("/param-require")
@ResponseBody
public String paramRequired(@RequestParam(required = true) String name, @RequestParam(required = false) int count) {
	return "hello";
}

@RequestMapping("/param-default")
@ResponseBody
public String paramDefault(
        @RequestParam(defaultValue = "john") String name,
        @RequestParam(defaultValue = "0") int count) {
    return "hello";
}

required = true 옵션을 줘도 String을 Param으로 받으면 빈값을 입력해도 유효성을 통과한다.
defaultValue를 설정하면 빈값의 처리도 해준다.

Affirmation

  • 서로 협업하면서 문제해결하기

좋은 웹페이지 즐겨찾기