관리 메뉴

bright jazz music

java.lang.IllegalArgumentException: Name for argument type [java.lang.Integer] not available, and parameter name information not found in class file either. 본문

오류

java.lang.IllegalArgumentException: Name for argument type [java.lang.Integer] not available, and parameter name information not found in class file either.

bright jazz music 2022. 7. 12. 11:14

java.lang.IllegalArgumentException: Name for argument type [java.lang.Integer] not available, and parameter name information not found in class file either.

 

컴파일 시 debugging enabled 가 되어 있지 않으면 발생.

파라미터에 관한 정보를 찾지 못해서 발생하는 오류이다.

 

 

 

@PathVariable(name="listNo") integer listNo 처럼 name을 써주면 가능

 

 

@RequestParam의 네 가지 파라미터

- defaultValue : 값이 없을 때 기본으로 전달할 값

- name: uri에서 바인딩 할 파라미터의 이름. The name of the request parameter to bind to.

- value: uri에서 바인딩하여 별칭으로 정할 값.  Alias for name().

- required: 필수적으로 값이 전달되어져야 하는 파라미터. 없으면 에러 발생

 

name과 value는 기능상 차이가 없음. 

 

 

 

참조: https://stackoverflow.com/questions/42326686/requestparam-name-vs-value-attributes

 

https://blog.katastros.com/a?ID=01800-62477206-d2b9-42aa-b2f0-ed2d47bcecd2 

 

Annotate the difference between the name and value attributes of @PathVariable (springmvc) - Katastros

After SpringMVC4.2, there are 4 parameters inside the RequestParam annotation: 1. String name; 2. String value; 3. boolean required; 4. String defaultValue; There are two attributes name and value that can be used to specify fields and variables What is th

blog.katastros.com

 

이는 @RequestParam에서도 동일하다.

 

 

@RequestParam, name vs value attributes

I am reading the documentation of the @RequestParam annotation in Spring MVC. What is the difference between name and value attributes? The documentation says: value : Alias for name(). n...

stackoverflow.com

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestParam.html

 

RequestParam (Spring Framework 5.3.21 API)

Whether the parameter is required. Defaults to true, leading to an exception being thrown if the parameter is missing in the request. Switch this to false if you prefer a null value if the parameter is not present in the request. Alternatively, provide a d

docs.spring.io

 

Comments