inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

섹션 8 .. API서버에서 사용자 정보 추출하기(2) 질문입니다.

미해결

코드로 배우는 React 19 with 스프링부트 API서버

accessToken을 넘기는데 undefined가 떠서 컨트롤러에 오지 못하는 거 같습니다. socialcontroller 입니다. 리액트 kakaoAPI.js 입니다. accessToken을 쿼리스트링으로 잘 보내고 받는 코드는 맞는거 같은데 왜 undefined가 뜨는지 모르겠습니다...

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
오현택 댓글 2 좋아요 1 조회수 267

섹션1 프로젝트 생성의 13분 23초 부분

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 스프링 입문의 섹션 1 '프로젝트 생성' 강의 부분을 따라가고 있는데 막혀서 질문드립니다. 자바 21을 설치하고 환경변수 설정하고 강의를 따라 13분 23초에 나온대로 일단 실행해보는 부분을 하려는데 자꾸만 빨간 글씨로 에러 메세지가 나와서 다음으로 넘어갈 수가 없습니다. 다른 질문들 찾아보고 구글링 해봐도 잘 모르겠습니다. 도움주시면 감사하겠습니다...!

  • java
  • spring
  • mvc
  • spring-boot
inftmdwo 댓글 1 좋아요 0 조회수 159

assertThat 윈도우 작동안됨

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] assertThat은 작동이 안되는 것으로 나옵니다.

  • java
  • spring
  • mvc
  • spring-boot
kuj0057 댓글 2 좋아요 0 조회수 627

kafka 와 redis pub/sub 비교

미해결

실습으로 배우는 선착순 이벤트 시스템

Redis 자체에 pub/sub 이라는 기능이 있는 걸로 알고있습니다. 이 기능은 kafka 랑 동일한 동작을 하지 않을까 하는 생각이 들었는데요.. 현재 프로젝트에 kafka 대신 redis의 pub/sub 을 사용해서 부하를 줄일 수도 있을까요?

  • java
  • docker
  • spring-boot
  • kafka
  • redis
tete 댓글 1 좋아요 0 조회수 576

item엔티티에 질문있습ㄴ디ㅏ.

미해결

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

Item엔티티도 OrderItem과 (아이템기준)onetomany인데 왜 private List<OrderItem> orderItems = new ArrayList<>(); item에 이런문구를안넣어주나요?

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
zzzzz 댓글 2 좋아요 0 조회수 169

서비스 코드 에러

미해결

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 6s 3 actionable tasks: 1 executed, 2 up-to-date 이런 오류가 뜹니다. 코드보다 설정 문제인 것 같은데 혹시 뭐가 문제일까요?

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
감자 댓글 1 좋아요 0 조회수 224

다음 강의 오픈 일정 알 수 있을까요?

미해결

토비의 스프링 부트 - 이해와 원리

늦으면 4월이라고 하신 답변을 본 것 같은데 기다리고 있습니다!!

  • spring
  • spring-boot
  • spring-jdbc
이지훈 댓글 2 좋아요 0 조회수 538

useParam() 사용 질문

미해결

코드로 배우는 React 19 with 스프링부트 API서버

학습을 하던 중 코드에 궁금중이 생겨 질문드립니다. 현재 modifyPage.js를 보면 인자에 tno를 받아와 사용하고 있습니다. 그리고 readPage.js에서는 useParam()을 이용해 tno 값을 받아와 사용하고있는걸 확인하고 readPage에서도 ModifyPage 에서 처럼 useParam()을 사용하지 않고 인자로 받아와 사용하는 방식으로 해보았는데 오류가 나는데 왜그런걸까요? 위의 코드를 이렇게 바꾸면 오류가 납니다.

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
yso829612 댓글 1 좋아요 0 조회수 252

MVC vs API

해결됨

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

아 아까 MVC와 API의 차이에 대해 질문했었는데요... 제가 그럼 프론트엔드 기술 (react, vue 등)을 모르는데 혼자 화면까지 나오는 프로젝트를 진행하고 싶다면 SSR인 템플릿 엔진을 이용한 MVC패턴으로 개발하는 게 더 나을까요?? 그러기엔 템플릿 엔진을 사용하더라도 JS나 css는 기본적으로 할 줄 알아야 할 거 같은데 ㅜㅜ 혼자서는 무리겠죠??

  • java
  • spring
  • aws
  • mysql
  • spring-boot
  • jpa
JMJ 댓글 1 좋아요 2 조회수 457

generate에 getter sectter이 없어요

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 이게 다예요 alt + insert 도 눌러보고 마우스 우클릭하고 접근해봐도 게터섹터가 없네요

  • java
  • spring
  • mvc
  • spring-boot
kuj0057 댓글 2 좋아요 0 조회수 627

AuthenticationManager에 초기화에 대해 질문있습니다

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

@Bean public AuthenticationManager authenticationManager(AuthenticationConfiguration configuration) throws Exception { return configuration.getAuthenticationManager(); } 위 처럼 Bean 으로 등록하게되면 내부 메서드에서 Bean으로 등록된 Builder를 통해 등록하는거 까지는 이해했는데요. 근데 여기서 setShareObject와 같은게 없는데 return http.build(); 빌드하게되면 HttpSecurity 메서드의 @Override protected void beforeConfigure() throws Exception { if (this.authenticationManager != null) { setSharedObject(AuthenticationManager.class, this.authenticationManager); } else { ObservationRegistry registry = getObservationRegistry(); AuthenticationManager manager = getAuthenticationRegistry().build(); if (!registry.isNoop() && manager != null) { setSharedObject(AuthenticationManager.class, new ObservationAuthenticationManager(registry, manager)); } else { setSharedObject(AuthenticationManager.class, manager); } } } 가 호출되어 여기서 else 조건을 타 getSharedObject 로 AuthenticationManagerBuilder 빌더 클래스를 다시 꺼내와서 빌드를 하는데 이렇게 되면 http.build 과정의 인증관리자와 스프링컨테이너에 있는 인증관리자는 서로 다른건가요? 같다면 우리가 등록한 Bean이 build 과정에서 나올것같은데 못찾겠습니다 ㅠㅠ..

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
smathj 댓글 2 좋아요 0 조회수 401

post userId 매칭

미해결

[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발

안녕하세요 강사님 좋은 강의 감사드립니다. post를 insert 할 때 user의 id가 post 의 user_id로 어떻게 매핑이 되어 db에 insert가 되는건지 궁금합니다. 컬럼명을 따로 지정해준 것도 아닌데 어떻게 이렇게 매핑이 자동(?)으로 매핑이 되는 건가요? post 엔티티에서 setUser할 때 알아서 되는것일까요? 확인해주시고 답변 주시면 감사드리겠습니다 !

  • rest-api
  • spring-boot
chaelynjang 댓글 1 좋아요 0 조회수 151

DTO 초기화 관련 질문드립니다.

미해결

실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화

@Data public class MemberSessionDto { private Long id; private String email; private String password; private String name; private Address address = new Address(); private List<Post> posts; } DTO의 필드 중 데이터가 들어있지 않은 필드가 존재할 수도 있을텐데요, 이럴 때는 new Address()와 같이 초기화를 해주는 것이 좋을까요, 아니면 타임리프에서 th:if="${findMember.address != null}" 와 같이 null 처리를 해주는 것이 좋을까요? 도움이 되실까 해서 엔티티 코드도 추가로 첨부하겠습니다. package com.myproject.jpaboard.domain; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.ArrayList; import java.util.List; @Entity @Getter @Setter @NoArgsConstructor(access = AccessLevel.PUBLIC) public class Member { @Id @GeneratedValue @Column(name = "member_id") private Long id; private String email; private String password; private String name; @Embedded private Address address; @OneToMany(mappedBy = "member", cascade = CascadeType.ALL, fetch = FetchType.LAZY) private List<Post> posts = new ArrayList<>(); @Override public String toString() { return "Member{" + "address=" + address + ", name='" + name + '\'' + ", password='" + password + '\'' + ", email='" + email + '\'' + ", id=" + id + '}'; } }

  • java
  • spring
  • spring-boot
  • jpa
Jaesang Yoon 댓글 1 좋아요 0 조회수 475

SecurityContextHolderStrategy 설명해주신 부분에서 기존 방식 변경 방식에 대한 질문입니다.

해결됨

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요, 24:00 에 말씀해주시는 SecurityContextHolderStrategy 사용하기부분에 기본방식과 변경방식 설명해주시는 부분에서 이해가 안되는 부분이 생겨 질문드립니다. 기존방식과 변경방식의 구현된 소스코드를 보니 내부에서(SecurityContextHolder.crateEmptyContext() 내부) 도 결론적으로는 strategy.createEmptyContext() 를 delegate 하는 방식으로 호출 되는것을 보았습니다. 6.x, 5.x, 4.x 모두 동일한듯합니다. /** * Allows retrieval of the context strategy. See SEC-1188. * @return the configured strategy for storing the security context. */ public static SecurityContextHolderStrategy getContextHolderStrategy() { return strategy; } /** * Delegates the creation of a new, empty context to the configured strategy. */ public static SecurityContext createEmptyContext() { return strategy.createEmptyContext(); } AbstractAuthenticationProcessingFilter 쪽에서 successfulAuthentication 쪽에 로직dl 6.x, 5.7 이하 버전 대가 다른단것은 확인했는데 /** * Puts the <code>Authentication</code> instance returned by the authentication * manager into the secure context. */ protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException, ServletException { this.logger.debug(LogMessage.format("Authentication success: %s", authResult)); SecurityContext context = this.securityContextHolderStrategy.createEmptyContext(); context.setAuthentication(authResult); this.securityContextHolderStrategy.setContext(context); this.securityContextRepository.saveContext(context, request, response); if (this.eventPublisher != null) { this.eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } if (this.authenticationSuccessHandler != null) { this.authenticationSuccessHandler.onAuthenticationSuccess(request, response, authResult); } } /** * Puts the <code>Authentication</code> instance returned by the authentication * manager into the secure context. */ protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException, ServletException { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); // Fire event if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent( authResult, this.getClass())); } if (authenticationSuccessHandler != null) { authenticationSuccessHandler.onAuthenticationSuccess(request, response, authResult); } } 추측건데 strategy 쪽을 세팅할수있는 부분이 추가됨에따라 달라진 부분이라 생각이 되어 이부분도 말씀하신 의도와는 다를듯하여 /** * Sets the {@link SecurityContextHolderStrategy} to use. The default action is to use * the {@link SecurityContextHolderStrategy} stored in {@link SecurityContextHolder}. * * @since 5.8 */ public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) { Assert.notNull(securityContextHolderStrategy, "securityContextHolderStrategy cannot be null"); this.securityContextHolderStrategy = securityContextHolderStrategy; } 경쟁조건 때문이라고 설명하신 부분에서 말씀하시는 의도를 다시 한번 알수있을까요.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
램쥐뱅 댓글 2 좋아요 0 조회수 563

과제 5번 cannot find symbol (sequencedMap) 오류

미해결

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

과제 5 관련 어제자 스레드에 올려주신 파일에서 DiceRollResults.java package com.group.libraryapp.day5Practice; import java.util.LinkedHashMap; import java.util.SequencedMap; public class DiceRollResults { private final SequencedMap<Integer, Integer> map = new LinkedHashMap<>(); public DiceRollResults(int maxDiceNumber) { for (int i = 1; i <= maxDiceNumber; i++) { map.put(i, 0); } } public void count(int rollResult) { int updated = map.get(rollResult) + 1; map.replace(rollResult, updated); } public SequencedMap<Integer, Integer> getMap() { return map; } } cannot find symbol (class sequencedMap) 오류가 나는데, 해결방법이 있을까요?

  • java
  • spring
  • aws
  • mysql
  • spring-boot
  • jpa
이혜리 댓글 1 좋아요 1 조회수 193

MVC와 API의 차이점

미해결

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

안녕하세요 강사님!! 다름이 아니라 공부를 하다가 MVC와 API의 차이점(?)에 대해 알아보게 되었습니다! 그래서 내린 결론이 Spring MVC구조의 @Controller는 컨트롤러의 리턴값이 ViewResolver에 의해 해석되어서 특정 View가 html응답으로 전송된다. 반면 REST API구조의 @RestController에 의한 호출은 View를 리턴하는 것이 목적이 아닌, 데이터를 전송하는 것을 목적으로 응답이 전송되어 진다. 라고 내렸습니다. 첫번째로, 위에서 제가 내린 결론이 맞는 말인지와 두번째로, 그럼 MVC를 쓰는 경우와 API를 쓰는 경우가 언제인지가 궁금합니다. 제가 아직 개념이 부족해서 그런건지는 몰라도 MVC를 쓰면 프론트엔드의 역할이 없어지는게(?) 아닌가 하는 착각이 들어서... 답변 부탁드리겠습니다!!

  • java
  • spring
  • aws
  • mysql
  • spring-boot
  • jpa
JMJ 댓글 1 좋아요 0 조회수 1170

상품수정에서 book 타입 캐스팅 질문입니다.

미해결

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 상품 수정할때 updateItemForm 메서드를 작성하면서 Book item = (Book) itemService.findOne(itemId); 이 코드를 작성하는데, 이게 가능하려면 itemService.findOne 메서드에서 리턴하는 객체가 원래 업캐스팅됐던 객체여야 가능한거 아닌가요? itemService.findOne은 itemRepository.findOne(itemId)을 리턴하고, ItemRepository의 findOne은 em.find(Item.class, id) 을 리턴합니다. 이 과정에서 언제 업캐스팅 되는건가요? 혹시 질문이 잘못 됐거나 제가 잘못 알고 있는 내용이 있다면 설명해주시면 감사하겠습니다.

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
쿠케캬캬 댓글 2 좋아요 0 조회수 287

LocalDateFormatter 사용 유무 차이

미해결

코드로 배우는 React 19 with 스프링부트 API서버

현재 LocalDateFormatter를 사용한 것과 사용하지 않았을 때 register 함수를 실행해보았는데 두 경우 모두 문제 없이 동일한 동작을 해서 아직 필요성을 못느끼겠는데 차이를 느끼려면 어떻게 테스트해보아야할까요?

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
yso829612 댓글 1 좋아요 0 조회수 249

ApplyService#apply 트랜잭션 문제

해결됨

실습으로 배우는 선착순 이벤트 시스템

안녕하세요~ 강의 중 ApplyService#apply 트랜잭션 관련해서 질문이 있습니다. apply 메서드가 appliedUserRepository#add 만 호출되거나 couponCountRepository#increase 까지만 호출되고 에러, 시스템 다운 등 특정 이유로 couponCreateProducer#create 는 호출되지 않게 되었을 때에 대한 처리가 필요할 것 같습니다. 어떻게 처리하는 것이 좋을까요?? @Service @RequiredArgsConstructor public class ApplyService { private final CouponRepository couponRepository; private final CouponCountRepository couponCountRepository; private final CouponCreateProducer couponCreateProducer; private final AppliedUserRepository appliedUserRepository; public void apply(final Long userId) { final Long applied = appliedUserRepository.add(userId); if (applied != 1) { return; } final long count = couponCountRepository.increase(); if (count > 100) { return; } couponCreateProducer.create(userId); } }

  • java
  • docker
  • spring-boot
  • kafka
  • redis
심플스택 댓글 1 좋아요 0 조회수 175

excludeTags 오류

미해결

견고한 결제 시스템 구축

안녕하세요 강사님 build.gradle에서 excludeTags("TooLongTime")를 추가하고 Reload All Gradle Projects 를 하는 과정에서 아래와 같이 오류가 발생합니다 Caused by: java.lang.ClassNotFoundException: org.gradle.internal.impldep.org .junit.platform.launcher.TagFilter Unable to load class ' org.gradle.internal.impldep.org .junit.platform.launcher.TagFilter'. This is an unexpected error. Please file a bug containing the idea.log file.

  • spring
  • spring-boot
  • dbms/rdbms
  • backend
  • payments
강프로그래머 댓글 3 좋아요 0 조회수 441

인기 태그

인프런 TOP Writers

주간 인기글