본문 바로가기

Study/Exception

java.lang.IllegalStateException: Optional int parameter 'num' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

에러코드

 

폼을 넘겨야 되는데... location.href 를 해서 get 방식으로 넘어감.

그래서 getMapping이 호출되면서 num을 넘기지 않으니까 에러가 발생함.

 

수정하니 잘 됨..

그 전 html에서 location을 썼더니 무의식 적으로 같은 방식을 써버림...

 

이것저것 해보고 검색해보다가 디버깅해보고 눈치챔