분류 전체보기(129)
-
@RequestParam-템플릿 에러
개발환경jdk_21Spring FrameworkThymeleaf 에러 내용Error resolving template [request-param], template might not exist or might not be accessible by any of the configured Template Resolversorg.thymeleaf.exceptions.TemplateInputException: Error resolving template [request-param], template might not exist or might not be accessible by any of the configured Template Resolvers- request-param 요청을 처리할 템플릿이 없거나,..
2024.08.04 -
@RequestParam - 파라미터 미기입
증상화이트라벨 에러 페이지로 이동하며, 400 Bad Request 에러가 발생함 원인Controller 에서 @RequestParam을 통해 값을 바인딩 한다고 정의 했으나,바인딩 할 값을 찾을 수 없어서 발생함. 해결 방법@RequestParam() 설정값 변경required (필수 사항인가?) 의 기본값은 true 이다. false로 바꿔주면 된다. 해결 후에러 페이지로 넘어가지 않는다.param 은 null 이 된다. ** 아래와 같이 파라미터 키값만 입력하고 value 를 넣지 않으면http://localhost:8080/request-param?param=param엔 빈 문자열이 들어간다.(null과 다름)
2024.08.04 -
@RequestParam
용도url 등을 통해 값을 입력받을 때, url에 입력한 key = value 의 내용들을 개발 언어와 바인딩 해준다. 문법컨트롤러 내 메서드 소괄호 내에 작성(@RequestParam("key") String key) 보다 명확한 표기는 value = 을 명시하는 것이지만, 너무 자주 사용되서 생략 가능하다.(@RequestParam(value = "key") String key) // url// http://localhost:8080/request-param?param=바인딩하라@GetMapping("requestparam") public void helloMVC(@RequestParam("param") String param) { System.out.println(param); /..
2024.08.04 -
자바 버전 오류
오류 내용xception in thread "main" java.lang.UnsupportedClassVersionError: com/first/spring/start/StartApplication has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 61.0- 높은 버전에서 컴파일된 놈이라 하위 버전에서 실행이 안 됨. 상황spring 프로젝트 build 후.java -jar 로 스냅샷.jar 실행하려고 하자 오류 발생함. 체크 - 인텔리제이 project stru..
2024.08.03 -
build 해보기
터미널 등을 통해프로젝트 dir 까지 이동. 해당 디렉토리에 gradlew 파일이 있는지 확인 하고 ./gradlew build 터미널에서 뭐가 %도 쭊쭊 차오르고 완료되면 해당 프로젝트 디렉토리 - build 에 libs 폴더와 함게 스냅샷 파일이 생김. java -jar 스냅샷.jar 실행으로 실행됨.
2024.08.03 -
spring-boot-devtools
https://docs.spring.io/spring-boot/docs/1.5.16.RELEASE/reference/html/using-boot-devtools.html 20. Developer toolsApplications that use spring-boot-devtools will automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE as it gives a very fast feedback loop for code changes. By default, any entry on the classpathdocs.spring.io ClassPath에 있는..
2024.08.03