inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

[공유] react-mention 항상 커서 위에 나오게 수정

미해결

Slack 클론 코딩[실시간 채팅 with React]

이전 질문을 보면 react-mention 추천이 커서 아래로 나온다고 해서 공식 문서를 확인해봤습니다. 결론적으로는 forceSuggestionsAboveCursor을 사용하면 됩니다. 해당 내용은 제로초님 sleact 레파지토리에 pull request 하였습니다. allowSuggestionsAboveCursor는 아래 공간이 부족하면 위에 배치가 '가능'하도록, 즉 워크스페이스 사람이 적으면 아래로 배치 forceSuggestionsAboveCursor는 항상 위로 배치 allowSuggestionsAboveCursor: Renders the SuggestionList above the cursor if there is not enough space below forceSuggestionsAboveCursor: Forces the SuggestionList to be rendered above the cursor

  • 웹팩
  • Socket.io
  • babel
  • typescript
  • react
  • 클론코딩
alvinlog 댓글 3 좋아요 2 조회수 918

기본 DaoAuthenticationProvider사용시 인증객체 조회 에러

미해결

스프링 시큐리티

프로젝트를 다시 만들어 실습을 진행중에 있습니다. 이번 프로젝트에서는 CustomAuthenticationProvider를 생성하지 않고 기본으로 사용되는 DaoAuthenticationProvider를 사용할려고 CustomAuthenticationProvider를 등록하지 않았습니다. 그런데 @GetMapping("/denied") public String accessDenied(@RequestParam(value = "exception", required = false) String exception, Model model) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Account account = (Account)authentication.getPrincipal(); model.addAttribute("username", account.getUsername()); model.addAttribute("exception", exception); return "user/login/denied"; } 이 컨트롤러에서 인증 객체 조회가 되지 않아 에러가 발생했습니다. 기존 프로젝트의 CustomAuthenticationProvider에서의 인증 로직이 끝나고 UsernamePasswordAuthenticationToken타입으로 인증객체가 return되고 이것이 SecurityContext에 저장되는 흐름과 현재 진행중 프로젝트의 DaoAuthenticationProvider에서 인증 로직이 끝나고UsernamePasswordAuthenticationToken타입으로 인증객체가 return되고 이것이 SecurityContext에 저장되는 흐름이 완전히 동일하다고 생각되어서 기존 프로젝트와 똑같이 컨트롤러에서 인증객체가 조회될 것이라고 생각했는데 그렇지 않습니다. 혹시 인증 흐름상에서 제가 놓치고 있는 부분이 있는건가요?

  • spring-boot
  • Spring Security
  • java
조우현 댓글 1 좋아요 0 조회수 1024

질문 드립니다!

미해결

나도코딩의 자바 기본편 - 풀코스 (20시간)

안녕하세요, 강사님. 강사님 도움 덕분에 1회차 한번씩 다 돌리고 2회차 다시 정주행 하면서 복습중입니다. 이제 이 것도 거의 끝나가네요. 다 강사님 덕분입니다. 😄 궁금한 것이 생겨 문의드립니다! ArrayList<Customer> customer = new ArrayList<>(); customer.add(new Customer(20, "챈들러")); customer.add(new Customer(42, "레이첼")); customer.add(new Customer(21, "모니카")); customer.add(new Customer(18, "벤자민")); customer.add(new Customer(5, "제임스")); customer.stream().map(x -> x.age >= 20 ? x.name + " 5000원" : x.name + " 무료" ) .forEach(System.out::println); 위와 같은 코드가 있을 때. 최종 연산 forEach 에서는 어떤 기준으로 cumtomer 객체의 name 값을 출력해주는지 알 수 있을까요? (따로 x.name 을 출력하라는 코드를 작성한게 없어 보이는데 name 만 한거 같아서요!) 데이터를 전체 출력해주는 거였다면 챈들러 5000원 20 레이첼 5000원 42 모니카 5000원 21 벤자민 무료 18 제임스 무료 5 이렇게 출력됐어야 할 것 같아서요. 그리고 혹시 만약 마지막 최종연산 forEach 에서 list 에 담긴 객체의 특정 필드값만 순회하면서 출력하는 방법도 있을까요?

  • oop
  • java
흰머리오목눈이 댓글 2 좋아요 1 조회수 577

수업 내용에 대해 질문드립니다.

미해결

[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지

안녕하세요 http.createServer(async (req, res) => { try { if (req.method === 'GET') { if (req.url === '/') { const data = await fs.readFile(path.join(__dirname, 'restFront.html')); res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); return res.end(data); } else if (req.url === '/about') { const data = await fs.readFile(path.join(__dirname, 'about.html')); res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); return res.end(data); } else if (req.url === '/users') { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); return res.end(JSON.stringify(users)); } // /도 /about도 /users도 아니면 try { const data = await fs.readFile(path.join(__dirname, req.url)); return res.end(data); } catch (err) { // 주소에 해당하는 라우트를 못 찾았다는 404 Not Found error 발생 } restFront.js , restFront.css 등을 받아오는 try 부분에서 강의에는 const data = await fs.readFile(`.${req.url)`);로 수업하셨는데 책과 깃헙예제에는 const data = await fs.readFile(path.join(__dirname, req.url)); 로 되어있어가지구요 1. .${req.url} 에서 백틱과 .은 꼭 쓰여야 하는건지랑 2. 책의 예제코드에서 __dirname의 경로는 restServer.js가 있는 위치가 기준이 되는건지 질문드립니다. else if (req.method === 'POST') { if (req.url === '/user') { let body = ''; // 요청의 body를 stream 형식으로 받음 req.on('data', (data) => { body += data; }); // 요청의 body를 다 받은 후 실행됨 return req.on('end', () => { console.log('POST 본문(Body):', body); const { name } = JSON.parse(body); const id = Date.now(); users[id] = name; res.writeHead(201, { 'Content-Type': 'text/plain; charset=utf-8' }); res.end('등록 성공'); }); } } return req.on('end', () =>{}) 에서 'end'라는 이벤트가 어느 부분에서 발생해서 저기 들어가는건지도 궁금합니다.

  • mysql
  • nodejs
  • mongodb
  • typescript
  • Socket.io
  • express
  • jwt
Donggun Jang 댓글 1 좋아요 0 조회수 506

셀레니움으로 네이버를 열고나서 갑자기 data;라는 주소로 바뀌고 내용이 사라집니다.

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

현재 코드는 아래와 같습니다. 자꾸 에러뜨는게 있어서 구글링하면서 2줄이 추가되었네요. options = Options() ## ERROR:device_event_log_impl.cc(218) 방지코드 options.add_argument('--no-sandbox') options.add_experimental_option("excludeSwitches", ["enable-logging"]) ## 화면 창 유지해주는 코드 options.add_experimental_option("detach", True) 그런데, 네이버 창이 떠서 잠시 머물다가 창이 꺼지진 않고 이렇게 바뀝니다. 주소가 data; 내용은없음.. 무엇이 문제일까요. 구글링해도 잘 못찾겠네요.

  • selenium
  • 웹-크롤링
  • python
  • beautifulsoup
쥰쓰 댓글 2 좋아요 0 조회수 1301

질문 드립니다

미해결

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

안녕하세요 선생님. JdbcTemplate이 있기 때문에 UserController가 인스턴스화되지 않아도 실행된다고 하셨는데 CalculatorController에 JdbcTemplate이 없는데 어떻게 실행되는 건가요? 답변 감사드립니다.

  • spring
  • mysql
  • java
  • spring-boot
  • JPA
  • aws
댓글 1 좋아요 1 조회수 322

provider등록시에 우선권이 궁금합니다.

해결됨

스프링 시큐리티

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 좋은 강의 감사합니다. 공부중에 궁금한게 있어서 글을 적습니다. CustomAuthenticationProvider는 현재 support로 UsernamePasswordToken인지 확인하고 있는데 DaoProvider의 경우에도 같은UsernamePasswordToken으로 검증하고 있던데 이런 경우 제가 등록한 provider가 더 우선권을 갖게 되어서 provider list를 순회 할때 custom provider가 더 먼저 지나가게 됨으로 daoprovider는 거치지 않는 것이 맞는건가요? 또한 제가 등록한 custom provider는 parent로 daoprovider를 갖게 되는지도 궁금합니다.

  • spring-boot
  • java
  • Spring Security
녹차 댓글 1 좋아요 0 조회수 331

검색어 입력 관련

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

연습삼아 나라장터의 상단 부분에 셀레니움을 통해 특정 검색어를 입력 후 검색을 실행 하려합니다 관련하여, 해당페이지 접속 후 단순히 find.element를 통해 driver.find_element( By.ID ,"AKCKwd").sendkeys("검색어") 와같이 사용할 수는 없는 것 인지요?

  • beautifulsoup
  • python
  • 웹-크롤링
  • selenium
SANGYUN LEE 댓글 3 좋아요 1 조회수 546

친구인가?(Union&Find) 첫 case1에서 타임리밋뜨는 이유

미해결

자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비

채점 결과 태스트 케이스2~5까지는 정답으로 나옵니다. 4개 모두 200ms안에 끝납니다 반면에 가장 테스트 케이스 크기가 작을 case1에서는 타임리밋이 뜹니다 이유는 무엇이고 해결책은 무엇일까요? import java.util.*; public class Main { static String answer = "NO"; static int N,M; static int[] ch,dis; public void BFS(int t1, int t2, ArrayList<ArrayList<Integer>> arr) { Queue<Integer> Q = new LinkedList<>(); Loop:for(int i = 1;i<=N;i++) { if(ch[i] == 0) { Q.offer(i); while(!Q.isEmpty()) { int tmp = Q.poll(); ch[tmp] = 1; dis[tmp] = 1; if(dis[t1] == 1 && dis[t2]==1) { answer = "YES"; break Loop; } int len = arr.get(tmp).size(); for(int j = 0;j<len;j++) { int n = arr.get(tmp).get(j); Q.offer(n); } } Arrays.fill(dis, 0); } } } public static void main(String[] args){ Scanner in=new Scanner(System.in); N = in.nextInt(); M = in.nextInt(); ch = new int[N+1]; dis = new int[N+1]; ArrayList<ArrayList<Integer>> arr = new ArrayList<>(); for(int i = 0;i<=N;i++) { arr.add(new ArrayList<Integer>()); } for(int i = 0;i<M;i++) { int a = in.nextInt(); int b= in.nextInt(); arr.get(a).add(b); } int t1 = in.nextInt(); int t2 = in.nextInt(); Main T = new Main(); T.BFS(t1, t2, arr); System.out.print(answer); } }

  • java
  • 코테 준비 같이 해요!
김유중 댓글 1 좋아요 0 조회수 324

타임 리밋이 일어나는 이유를 모르겠습니다.

해결됨

자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비

혼자 풀어봤을 때, 다음과 같은 코드를 작성하였는데요. 타임리밋이 일어날 만한 곳이 while문밖에 없는거같아서 계속 보는데 이유를 모르겠습니다. 첫 요소가 K만큼 들어왔으면 그 다음부터는 1번씩만 put하니까 괜찮을 것이라 생각했는데 어떠한 이유로 타임리밋이 뜨는걸까요 ㅠㅠ? public static String solution(int n,int k,int[] arr) { String answer =""; HashMap<Integer,Integer> map = new HashMap<>(); // 매출의 종류 => HashMap & Sliding Window int lt=0; for(int rt = 0;rt<=(n-k);rt++) { while(lt-rt<k&&lt<n) { map.put(arr[lt], map.getOrDefault(arr[lt],0)+1); lt++; } answer += map.size()+" "; if(map.get(arr[rt])>1) { map.put(arr[rt], map.get(arr[rt])-1); }else { map.remove(arr[rt]); } } return answer; }

  • java
  • 코테 준비 같이 해요!
qkslzl101216 댓글 1 좋아요 0 조회수 511

광고상품 외 표기 문의드립니다.

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

안녕하세요. 답변 감사드립니다. 전체 코드를 첨부하여 다시 문의글 작성하였습니다. 쿠팡 광고상품과 로켓상품도 표기하고자 합니다. if len( link.select (".ad-badge-text")) > 0: print("광고상품") 를 아래와 같이 수정하면 될까요? 해봤는데 아무표기가 안되서요. if len( link.select ("span.badge rocket")) > 0: print("로켓상품") 그리고 광고상품 로켓상품 둘다 표현하고자 하면 아래와 같이 표기하면 될까요? if len( link.select (".ad-badge-text")) > 0: print("광고상품") elif len( link.select ("span.badge rocket")) > 0: print("로켓상품") 광고상품은 광고상품이라고 잘 표기가 되는게 로켓상품은 전혀 결과가 나오지 않아서요.

  • python
  • 웹-크롤링
suki 댓글 2 좋아요 2 조회수 449

상속관계 오류

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

Book.java Item 상속관계에서 오류가 발생했습니다..

  • java
  • JPA
kim1234123 댓글 2 좋아요 0 조회수 617

설정 오류

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

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

  • java
  • JPA
wxogud3377 댓글 2 좋아요 2 조회수 948

출력(전반전-정수)

미해결

나도코딩의 자바 기본편 - 풀코스 (20시간)

정수 3자리마다 콤마가 찍히는 원리를 답변 받고 싶습니다 ㅠㅠ

  • oop
  • java
문수 댓글 2 좋아요 -1 조회수 414

임베티드 타입에 대해 질문있습니다.

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

7분44초에 임베디드 타입에서 같은 객체를 사용하여 저장하고 setter를 통해서 값을 수정하게 되면 같은 객체의 인스턴스를 사용하기 때문에 값이 member1과 member2가 둘 다 바뀐다고 하셔서 제가 테스트를 해봤습니다. 같은 메서드에서 member1과 member2를 같은 address 객체를 사용해서 저장한 건 똑같은데 다른 메서드에서 아래에 코드 처럼 member1을 찾아와서 city를 수정하니 member2는 수정이 안된 것을 확인하였습니다. 이것은 다른 트랜잭션을 사용하기 때문에 같은 인스턴스를 공유하고 있지 않은 건가요? Member member = em.find(Member.class, 1L); member.getHomeAddress().setCity("city");

  • java
  • JPA
댓글 1 좋아요 0 조회수 401

Ajax 인증시 인가코드가 발급 되지 않는 원인 문의

해결됨

스프링 시큐리티 OAuth2

Spring Authorization 1.0,1 기반으로 개발을 하고 있습니다. 인가코드를 발급 할떄 FormLogin 기본 설정을 사용하면 인가코드가 발급이 되는데 Ajax 로 로그인을 하면 인가코드가 발급되지 않고 있습니다. 디버깅을 해보면 로그인인 후 OAuth2AuthorizationEndpointFilter 는 실행되는데 @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if (!this.authorizationEndpointMatcher.matches(request)) { filterChain.doFilter(request, response); return; } try { Authentication authentication = this.authenticationConverter.convert(request); if (authentication instanceof AbstractAuthenticationToken) { ((AbstractAuthenticationToken) authentication) .setDetails(this.authenticationDetailsSource.buildDetails(request)); } Authentication authenticationResult = this.authenticationManager.authenticate(authentication); if (!authenticationResult.isAuthenticated()) { // If the Principal (Resource Owner) is not authenticated then // pass through the chain with the expectation that the authentication process // will commence via AuthenticationEntryPoint filterChain.doFilter(request, response); return; } if (authenticationResult instanceof OAuth2AuthorizationConsentAuthenticationToken) { if (this.logger.isTraceEnabled()) { this.logger.trace("Authorization consent is required"); } sendAuthorizationConsent(request, response, (OAuth2AuthorizationCodeRequestAuthenticationToken) authentication, (OAuth2AuthorizationConsentAuthenticationToken) authenticationResult); return; } this.authenticationSuccessHandler.onAuthenticationSuccess( request, response, authenticationResult); } catch (OAuth2AuthenticationException ex) { if (this.logger.isTraceEnabled()) { this.logger.trace(LogMessage.format("Authorization request failed: %s", ex.getError()), ex); } this.authenticationFailureHandler.onAuthenticationFailure(request, response, ex); } } FormLogin 적용시에는 authenticationResult의 principal 에 UsernamePasswordAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되는데 AjaxLogin 적용시에는 authenticationResult의 principal 에 AnonymousAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되지 않고 403 예외가 발생합니다. AuthenticationProvider 구현체에서는 정상적으로 토큰을 저장하고 있습니다. AuthenticationProvider 구현체 소스 @Component @RequiredArgsConstructor public class CustomAuthenticationProvider implements AuthenticationProvider { private final CustomUserDetailsService customUserDetailsService; private final PasswordEncoder passwordEncoder; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(authentication == null){ throw new InternalAuthenticationServiceException("Authentication is null"); } LoginRequestDto loginRequestDto = (LoginRequestDto)authentication.getPrincipal(); String password = loginRequestDto.getLoginPassword(); UserAdapter userAdapter = (UserAdapter) customUserDetailsService.loadUserByLoinRequestDto(loginRequestDto); if (!passwordEncoder.matches(password, userAdapter.getCurrentUser().getLoginPwd())) { throw new BadCredentialsException("BadCredentialsException"); } CustomAuthenticationToken result = CustomAuthenticationToken.authenticated(userAdapter.getCurrentUser(), authentication.getCredentials(), userAdapter.getAuthorities()); result.setDetails(authentication.getDetails()); return result; } @Override public boolean supports(Class<?> authentication) { return CustomAuthenticationToken.class.isAssignableFrom(authentication); } } 이외 Custom 소스 Spring Security 설정 @EnableWebSecurity @RequiredArgsConstructor @Configuration public class DefaultSecurityConfig { private final CustomAuthenticationProvider customAuthenticationProvider; // private final CustomUserDetailsService customUserDetailsService; @Bean public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception { return authenticationConfiguration.getAuthenticationManager(); } @Bean public CustomAuthenticationProcessingFilter customAuthenticationProcessingFilter() throws Exception { CustomAuthenticationProcessingFilter filter = new CustomAuthenticationProcessingFilter(); // filter.setAuthenticationManager(authenticationManager(null)); filter.setAuthenticationManager(new ProviderManager(customAuthenticationProvider)); // filter.setAuthenticationSuccessHandler(customAuthenticationSuccessHandler()); // filter.setAuthenticationFailureHandler(customAuthenticationFailureHandler()); return filter; } // @formatter:off @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorizeRequests ->authorizeRequests .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers(new AntPathRequestMatcher("/")).permitAll() .requestMatchers(new AntPathRequestMatcher("/login/**")).permitAll() .requestMatchers("/api/login/**").permitAll() .requestMatchers("/api/registered-client/**").permitAll() .anyRequest().authenticated() ); http.addFilterBefore(customAuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class); http.exceptionHandling(httpSecurityExceptionHandlingConfigurer -> httpSecurityExceptionHandlingConfigurer .authenticationEntryPoint(new CustomLoginAuthenticationEntryPoint()) .accessDeniedHandler(customAccessDeniedHandler()) ); // http.userDetailsService(customUserDetailsService); // http.formLogin(); http.csrf().disable(); return http.build(); } // @formatter:on @Bean public AccessDeniedHandler customAccessDeniedHandler() { return new CustomAccessDeniedHandler(); } @Bean public AuthenticationSuccessHandler customAuthenticationSuccessHandler() { return new CustomAuthenticationSuccessHandler(); } @Bean public AuthenticationFailureHandler customAuthenticationFailureHandler() { return new CustomAuthenticationFailureHandler(); } } Ajax 로그인 처리 필터 소스 public class CustomAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter { private final ObjectMapper objectMapper = new ObjectMapper(); private static final AntPathRequestMatcher DEFAULT_ANT_PATH_REQUEST_MATCHER = new AntPathRequestMatcher("/api/login", HttpMethod.POST.name()); public CustomAuthenticationProcessingFilter() { super(DEFAULT_ANT_PATH_REQUEST_MATCHER); } public CustomAuthenticationProcessingFilter(AuthenticationManager authenticationManager) { super(DEFAULT_ANT_PATH_REQUEST_MATCHER, authenticationManager); } @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!request.getMethod().equals("POST")) { throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); } LoginRequestDto loginRequestDto = objectMapper.readValue(request.getReader(), LoginRequestDto.class); if(StringUtils.isEmpty(loginRequestDto.getLoginId())||StringUtils.isEmpty(loginRequestDto.getLoginPassword())) { throw new IllegalStateException("Username or Password is empty"); } CustomAuthenticationToken authRequest = CustomAuthenticationToken.unauthenticated(loginRequestDto, loginRequestDto.getLoginPassword()); authRequest.setDetails(this.authenticationDetailsSource.buildDetails(request)); return getAuthenticationManager().authenticate(authRequest); } } CustomAuthenticationToken 소스 public class CustomAuthenticationToken extends AbstractAuthenticationToken { private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID; private final Object principal; private Object credentials; public CustomAuthenticationToken(Object principal, Object credentials) { super(null); this.principal = principal; this.credentials = credentials; setAuthenticated(false); } public CustomAuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.principal = principal; this.credentials = credentials; super.setAuthenticated(true); // must use super, as we override } public static CustomAuthenticationToken unauthenticated(Object principal, Object credentials) { return new CustomAuthenticationToken(principal, credentials); } public static CustomAuthenticationToken authenticated(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { return new CustomAuthenticationToken(principal, credentials, authorities); } @Override public Object getCredentials() { return this.credentials; } @Override public Object getPrincipal() { return this.principal; } }

  • java
  • oauth
  • spring-boot
  • spring
신석균 댓글 2 좋아요 1 조회수 1392

채팅대화에서 시간이 중복될경우 안보이게 하는방법 문의.

미해결

Slack 클론 코딩[실시간 채팅 with React]

안녕하세요. 복습중에 새로운 기능을 넣으려고 하는데 생각보다 잘 안되네요. 카카오톡 메신저처럼. 동일한 시간에 보낸 카톡시간을 안보이게 하려고합니다. 서버에서 가져온 현재시간값과 이전 대화시간값(chat.createdAt) 을 비교하면 될것같은데 useState 를 이용할때는 무한로딩으로 막혓고 (setState 로 현재값 저장) useRef 를 사용해서 값을 저장하여 비교하고 싶은데. 항상 현재시간값만 이용하게 되네요. 어떻게 접근하는것이 좋을까요.

  • 클론코딩
  • react
  • babel
  • socket.io
  • Socket.io
  • 웹팩
  • 클론코딩
  • typescript
마페이지 댓글 1 좋아요 0 조회수 569

JdbcTemplate 테스트에서의 중복 회원 예외 오류가 뜨는 이유를 모르겠습니다.

미해결

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

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (비슷한 내용은 있었지만 원하는 해답을 찾지 못했습니다) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 여기에 질문 내용을 남겨주세요. 차근차근 강의 예제를 따라가면서 잘 오고 있었는데 테스트 하는 부분에서 갑작스런 오류로 인해 해답을 찾던 도중 어려움을 겪어서 프로젝트 링크와 오류 사진을 남기겠습니다 https://drive.google.com/file/d/1DIAzsFD6RnTCv73h-kNpeDWUE5CsF8oC/view?usp=share_link

  • spring-boot
  • mvc
  • MVC
  • spring
  • java
김동우 댓글 2 좋아요 1 조회수 738

static 메소드와 instance 메소드의 접근?

해결됨

나도코딩의 자바 기본편 - 풀코스 (20시간)

안녕하세요 ㅎㅎ 다름이 아니라 나도코딩 자바편에서 메소드를 공부하면서 궁금증이 생겨, 이렇게 또 다시 질문을 남깁니다...ㅎ 나도코딩 자바편을 보는 것과 동시에, 제 스스로 나름 예제들도 풀면서 개념을 익히고 있는데요...ㅎ 방금 전에 제가 문자열(String)배열과 charAt()을 이용하여, 전치행렬을 만드는데 성공했습니다...ㅎ 결과도 잘 출력했구요 ㅎㅎ 이 예제를 푸는 데는 String, String[], length(), charAt()에 대한 선생님의 도움과 답변이 없었으면 풀지 못했을 건데, 선생님의 자세한 답변 덕분에 문제를 빠르게 잘 풀 수 있었습니다. 감사합니다 ㅎㅎ 아래가 제가 쓴 코드고, 출력한 결과입니다: 여기서부터가 제 질문인데요...ㅎ static 메소드(public static void main(String[] args) {...})에서 일반 메소드를 접근하려면, 에러 메시지로 'non-static variable/method cannot be referenced fromstatic context.'라고 나오는데, 이럴 경우에 에러를 없애고, 결과를 잘 출력하려면: pubilc static void main 메소드 앞에 첫 번째 방법으로 void transpose 메소드를 static void tranpose라고 바꾸거나, 아니면 2번째 방법으로 static 메소드 안에서 이렇게 Question_03 making = new Question_03(); 즉, (클래스 이름) (객체 이름) = new (클래스 이름)(); 이런 식으로 객체화를 해서 메소드를 접근해야 하나요?

  • java
  • 객체지향
  • 메소드
  • oop
  • static
댓글 1 좋아요 0 조회수 751

섹션 4 -> 그리디 , 결정문제 질문

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

안녕하세요! 강의 정말 잘 듣고 있습니다. 섹션 4를 풀다가, 어떤 문제를 그리디를 쓰고, 어떤문제를 결정알고리즘을 써야하는지 감이 잡히지 않아서 질문 드립니다. 답변해주시면 정말 감사하겠습니다!

  • 코테 준비 같이 해요!
  • 코딩-테스트
  • python
깨위 댓글 1 좋아요 0 조회수 268

인기 태그

인프런 TOP Writers

주간 인기글