inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

HelloController 부분 오류

미해결

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

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 강의 내용이랑 똑같이 다 따라쳤고 확인도 해봤는데 머 때문에 오류 뜨는지 모르겠어요 ㅠㅠ

  • java
  • spring
  • mvc
  • spring-boot
Imking 댓글 3 좋아요 0 조회수 365

4.2 React 렌더링 과정 에서 왜 컴포넌트가 두 번씩 호출될까요?

미해결

실무 중심! FE 입문자를 위한 React

/*FunctionalComponent.jsx파일*/ import {useEffect,useState} from 'react'; function FunctionalComponent() { console.log('Function Beginning'); const [value, setValue] = useState(0); useEffect(() => { console.log('Function useEffect[]'); return () => { console.log('Function useEffect return[]'); } },[]); useEffect(() => { console.log('Function useEffect[value]'); return () => { console.log('Function useEffect return[value]'); } },[value]); console.log('Function End'); return ( <div> <h1>!FunctionalComponent</h1> <h1>value: {value}</h1> <button onClick={() => { setValue((state) => state + 1) }} > Increase value </button> </div> ); } export default FunctionalComponent /*App.jsx파일*/ import { useState } from 'react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' import './App.css' import axios from 'axios'; import FunctionalComponent from './practice/FunctionalComponent' function App() { return ( <FunctionalComponent /> ) } export default App

  • react
  • redux
  • node.js
  • sass
  • swr
최상협 댓글 1 좋아요 0 조회수 202

open ai api키 사용하는거 무료인가요?

해결됨

파이썬으로 나만의 블로그 자동화 프로그램 만들기

open ai api키 사용하는거 무료인가요?주시기 바랍니다.

  • python
  • wordpress
  • 웹-크롤링
  • selenium
코드스타크 댓글 2 좋아요 0 조회수 4442

데이터 분리하기 문의드립니다.

해결됨

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 라이브러리 및 데이터불러오기 20분지점 주어진 데이터 분리하기 train= pd.read _csv("train.csv") test= pd.read _csv("test.csv") 가 주어졌습니다. 이게 어느 단계에서의 작업이며, 데이터를 왜 분리하는지, 어떤 데이터를 분리하는지에 대해 전반적인 설명이 없어서 지금의 학습과정을 이해할 수 없습니다. train과 test가 주어졌다면 타겟레이블을 생성하는 과정이 아닐까 추측해 봤지만, 여기서는 income을 삭제했는데 왜 삭제했는지 이해가 안 갑니다. 설명을 바랍니다.

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
강민균 댓글 2 좋아요 0 조회수 130

react-beatiful-dnd에서 문제가 발생합니다.

미해결

따라하며 배우는 리액트 A-Z[19버전 반영]

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 기능상에 문제가 있는건 아니지만, 계속해서 아래의 에러가 발생합니다. 사용하고 있는 버전의 문제일까요? { "name": "react-todo-app", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/dom": "10.4.0", "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.2.0", "@testing-library/user-event": "13.5.0", "react": "^19.0.0", "react-beautiful-dnd": "13.1.1", "react-dom": "^19.0.0", "react-scripts": "5.0.1", "web-vitals": "2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "autoprefixer": "10.4.20", "postcss": "8.5.3", "tailwindcss": "3.4.17" } } Lists.js import React from 'react'; import List from './List.js' import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'; const Lists = React.memo(({todoData, setTodoData}) => { // console.log('Lists Component') const handleEnd = (result) => { if(!result.destination) return; const newTodoData = Array.from(todoData); const [reorderedItem] = newTodoData.splice(result.source.index, 1); newTodoData.splice(result.destination.index, 0, reorderedItem); setTodoData(newTodoData); } return <div> <DragDropContext onDragEnd={handleEnd}> <Droppable droppableId='todo'> {(provided, snapshot) => ( <div ref={provided.innerRef} {...provided.droppableProps} > {(todoData ?? []).map((data, index) => ( <Draggable key={data.id} draggableId={data.id.toString()} index={index} > {(provided, snapshot) => ( <List key={data.id} id={data.id} title={data.title} completed={data.completed} provided={provided} snapshot={snapshot} todoData={todoData} setTodoData={setTodoData} /> )} </Draggable> ))} {provided.placeholder} </div> )} </Droppable> </DragDropContext> </div>; }) export default Lists; App.js import React, {useState} from 'react' import "./App.css" import Lists from './components/Lists' import Form from './components/Form' export default function App() { // console.log('App Component') const [todoData, setTodoData] = useState([ { id: 1, title: '운동하기', completed: false, }, { id: 2, title: '공부하기', completed: false, } ]) const [value, setValue] = useState("") return ( <div className="flex items-center justify-center w-screen h-screen bg-blue-100" > <div className='full p-6 m-4 bg-white rounded shadow md:w-3/4 md:max-w-lg lg:w-3/4 lg:max-w-lg'> <div className="flex justify-between mb-3"> <h1>할 일 목록</h1> </div> <Lists todoData={todoData} setTodoData={setTodoData} /> <Form value={value} setValue={setValue} setTodoData={setTodoData}/> </div> </div> ) }

  • react
  • redux
  • tdd
  • typescript
  • next.js
  • 소프트웨어-테스트
  • react-beatiful-dnd
  • isdropdisabled
고유림 댓글 1 좋아요 0 조회수 127

useEffect 관련 질문드립니다.

미해결

실무 중심! FE 입문자를 위한 React

useEffect의 dependency array에 배열을 넣는 경우 "Maximum update depth exceeded." error가 발생하게 되는데, 이 경우는 어떻게 해야하나요? 예를 들어 아래와 같은 상황이라고 가정하겠습니다. 화면에는 테이블 1개만 존재한다. 데이터는 unknown[] 형태이다. 다른 조건에 의해 데이터의 갯수가 달라지는 경우에만 다시 렌더링한다. 코드로 예시를 들면 아래와 같습니다. const [items, setItems] = useState<unknown[]>([]); useEffect(() => void, [items]) 답변주시면 감사합니다.

  • react
  • redux
  • node.js
  • sass
  • swr
이준영 댓글 0 좋아요 0 조회수 147

Error: Route "/search" used `searchParams.q`. `searchParams` should be awaited before using its properties.

해결됨

한 입 크기로 잘라먹는 Next.js

안녕하세요 강사님 해당 오류는 최신버전에서 발생하는건가요?! Error: Route "/search" used searchParams.q . searchParams should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at Page (src/app/(with-searchbar)/search/page.tsx:12:32) 10 | return ( 11 | <div> > 12 | Search 페이지 : {searchParams.q} | ^ 13 | <ClientComponent> 14 | <></> 15 | </ClientComponent> import ClientComponent from "@/components/client-component"; export default function Page({ searchParams, }: { searchParams: { q?: string; } }) { return ( <div> Search 페이지 : {searchParams.q} <ClientComponent> <></> </ClientComponent> </div> ) }

  • react
  • typescript
  • next.js
강프로그래머 댓글 2 좋아요 0 조회수 253

#1090번 문제 반례가 궁금합니다.

미해결

2주만에 통과하는 알고리즘 코딩테스트 (2024년)

from copy import deepcopy def init_sort_checker(checkers): tmp_list = [] sorted_sum_list = [] for idx, chk in enumerate(checkers): for i, tgt in enumerate(checkers): if idx == i: #본인으로 가는 값은 제외 continue x_val = abs(chk[0] - tgt[0]) y_val = abs(chk[1] - tgt[1]) # price, [src, tgt] 순 정렬 tmp_list.append([x_val + y_val, [idx, i]]) tmp_list.sort(key=lambda x: x[0]) # price 값 적은 순서대로 정렬 sorted_sum_list.append(deepcopy(tmp_list)) tmp_list = [] return sorted_sum_list def sort_sum_target(sorted_sum_list, k): lowest_price = 1000000*k target_idx = -1 for idx, line in enumerate(sorted_sum_list): cnt = 0 line_price = 0 for price in line: if cnt >= k-1: break line_price = line_price + price[0] cnt += 1 if line_price < lowest_price: lowest_price = line_price target_idx = idx return target_idx def k_tgt_process(k, sorted_tgt, sorted_sum_list): tgt_line = sorted_sum_list[sorted_tgt] tgt_loc = [] for i in range(k-1): tgt_loc.append(tgt_line[i][1]) return tgt_loc def k_sorting_process(tgt_loc, checkers): tgt_list = [] for tgt in tgt_loc: tgt_list.append(tgt[0]) tgt_list.append(tgt[1]) tgt_list = list(set(tgt_list)) x_list = [] y_list = [] tgt_checkers = [] for tgt in tgt_list: x_list.append(checkers[tgt][0]) y_list.append(checkers[tgt][1]) tgt_checkers.append(checkers[tgt]) x_list.sort() y_list.sort() if len(x_list)%2 == 0: #짝수 x_chk_point = [int(len(x_list)/2-1),int(len(x_list)/2)] else: # 홀수 x_chk_point = [int(len(x_list)/2)] if len(y_list)%2 == 0: #짝수 y_chk_point = [int(len(y_list)/2-1),int(len(y_list)/2)] else: # 홀수 y_chk_point = [int(len(y_list)/2)] #모아볼 위치의 case 집합 chk_point_list = [] for x_chk in x_chk_point: for y_chk in y_chk_point: chk_point_list.append([x_chk,y_chk]) # 각 checker 위치에서 좌표로 이동하는데 드는 값 계산 ttl_price_list = [] for chk in chk_point_list: x_tgt = chk[0] y_tgt = chk[1] price_list = [] for checker in tgt_checkers: x = checker[0] y = checker[1] if x_list[x_tgt] > x: x_price = x_list[x_tgt] - x else: x_price = x - x_list[x_tgt] if y_list[y_tgt] > y: y_price = y_list[y_tgt] - y else: y_price = y - y_list[y_tgt] price = x_price + y_price price_list.append(price) price_list.sort() ttl_price_list.append(price_list) return ttl_price_list def TestCases(N): checkers = [list(map(int,input().split())) for _ in range(N)] sorted_sum_list = init_sort_checker(checkers) output_str = '0' for k in range(2, N+1): min_price = 2000000 sorted_tgt = sort_sum_target(sorted_sum_list, k) tgt_loc = k_tgt_process(k, sorted_tgt, sorted_sum_list) ttl_price_list = k_sorting_process(tgt_loc, checkers) for n_list in ttl_price_list: tmp = 0 for idx in range(k): tmp = tmp + n_list[idx] if tmp < min_price: min_price = tmp output_str = output_str + ' ' + str(min_price) tmp_str = list(map(int,output_str.split())) # print(output_str) print(*tmp_str) N = int(input()) TestCases(N) 다음과 같이 코드 작성해봤는데, sample input에 대한 답은 다 도출되지만문제 제출하면 답이 틀리다 나오네요..반례나 코드상의 오류를 도와주실 수 있을까요? [사용해본 input/output] 4 1 1 2 1 4 1 13 1 0 1 3 14 4 13 13 16 14 15 18 15 30 0 4 8 24 5 3 2 6 9 3 16 14 6 17 14 0 10 17 31 47 5 3 2 6 9 6 13 13 6 17 14 0 4 14 24 40 4 15 14 15 16 14 15 16 15 0 2 3 4 2 4 7 4 7 0 0 4 1 101 2 101 200 101 201 101 0 1 199 398

  • python
  • 코딩-테스트
  • 알고리즘
DaBin Han 댓글 1 좋아요 0 조회수 164

스프링 MVC 실용적인 방식 강의듣고 질문 있습니다~

미해결

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 위와같이 강의 따라서 @getMapping("/new-form") 이렇게만 해줘도 HTTP GET 메서드만 받을 수 있도록 제약할 수 있고, URL 매핑까지 된다는 걸 배웠는데요, @GetMapping("/new-form") 이렇게 @GetMapping 다음에 괄호를 열고 매핑할 url을 넣어주고 괄호를 닫으면 된다는 걸 저는 @GetMapping 소스코드에서 방법을 알려주는지 궁금했습니다. /* * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.bind.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.core.annotation.AliasFor; /** * Annotation for mapping HTTP {@code GET} requests onto specific handler * methods. * * <p>Specifically, {@code @GetMapping} is a <em>composed annotation</em> that * acts as a shortcut for {@code @RequestMapping(method = RequestMethod.GET)}. * * <p><strong>NOTE:</strong> This annotation cannot be used in conjunction with * other {@code @RequestMapping} annotations that are declared on the same method. * If multiple {@code @RequestMapping} annotations are detected on the same method, * a warning will be logged, and only the first mapping will be used. This applies * to {@code @RequestMapping} as well as composed {@code @RequestMapping} annotations * such as {@code @PutMapping}, {@code @PostMapping}, etc. * * @author Sam Brannen * @since 4.3 * @see PostMapping * @see PutMapping * @see DeleteMapping * @see PatchMapping * @see RequestMapping */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented @RequestMapping(method = RequestMethod.GET) public @interface GetMapping { /** * Alias for {@link RequestMapping#name}. */ @AliasFor(annotation = RequestMapping.class) String name() default ""; /** * Alias for {@link RequestMapping#value}. */ @AliasFor(annotation = RequestMapping.class) String[] value() default {}; /** * Alias for {@link RequestMapping#path}. */ @AliasFor(annotation = RequestMapping.class) String[] path() default {}; /** * Alias for {@link RequestMapping#params}. */ @AliasFor(annotation = RequestMapping.class) String[] params() default {}; /** * Alias for {@link RequestMapping#headers}. */ @AliasFor(annotation = RequestMapping.class) String[] headers() default {}; /** * Alias for {@link RequestMapping#consumes}. * @since 4.3.5 */ @AliasFor(annotation = RequestMapping.class) String[] consumes() default {}; /** * Alias for {@link RequestMapping#produces}. */ @AliasFor(annotation = RequestMapping.class) String[] produces() default {}; } 그래서 위와같이 @GetMapping 소스코드를 확인했는데, 뚜렸하게 방법을 알려준다는 건 제가 찾지 못했는데 혹시 제가 못찾는 것일까요? 아니면 제일 첫 줄에 있는 "Annotation for mapping HTTP GET requests onto specific handler methods." 이 문장으로 @GetMapping에 값을 그대로 적어주면 된다(괄호를 열고 url쓰고 닫으면 된다)고 알아들어야 하려나요?

  • spring
  • mvc
ajdsasld 댓글 2 좋아요 0 조회수 140

DB 테스트 코드 작성에서 .containsExactly에 관한 질문

미해결

스프링 DB 2편 - 데이터 접근 활용 기술

안녕하세요! 섹션 4 강의를 보다보니 의문점이 생겨서요 Repository를 테스트하는 과정에서 test() 메서드에 .containsExactly를 사용하고있습니다. 강사님께서 내용과 순서가 모두 맞아야 한다고 설명하시더라고요. 메모리에서의 테스트나 DB를 조회할 때 순서를 보장할 수 없는 것으로 알고있는데 문제가 있을 수도 있지만 간단한 테스트를 위해서 사용한것인지 아니면 실제로도 이런식으로 테스트 하는지 궁금합니다. 관련한 질문들을 확인했으나 만족할만한 답변이 없어서 질문드립니다.

  • spring
  • mvc
  • jpa
  • querydsl
  • spring-data-mybatis
  • spring-jpa
leedongjae625 댓글 2 좋아요 0 조회수 134

사이트 전체 Route 구조 짜기 영상 10분쯤 코드가 똑같은데 연결이 안되요

해결됨

(2025) MBTI 테스트 기반 수익형 웹사이트 만들기 - <코딩 배워 사업하자>

영상 10분쯤 나오는 파트에서 Main.jsx와 App.jsx 코드를 아예 똑같이 썼는데도 사이트에 연결할 수 없다고 뜹니다 어떻게 해야 하나요 vsc에서는 Main이 선언은 되었지만 해당 값이 읽히지는 않았습니다 ts(6133)이라고 뜯니다

  • react
  • aws
  • Google-Analytics
  • cloudflare
  • adsense
  • 수익화
도도한 염소 댓글 2 좋아요 0 조회수 271

12.18 새 일기 쓰기 페이지 제목 수정 관련

해결됨

한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지

index.html <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Emotion Diary</title> </head> <body> <div id="root"></div> <script type="module" src="/src/main.jsx"></script> </body> </html> New.jsx import Header from "../components/Header"; import Button from "../components/Button"; import Editor from "../components/Editor"; import { useNavigate } from "react-router-dom"; import { useContext, useEffect } from "react"; import {DiaryDispatchContext} from "../App"; import usePageTitle from "../hooks/usePageTitle"; const New=()=>{ const{onCreate}=useContext(DiaryDispatchContext); const nav=useNavigate(); usePageTitle(`${useParams.id}번 일기 수정`); const onSubmit=(input)=>{ onCreate( input.createdDate.getTime(), input.emotionId, input.content ); nav('/',{replace: true}); }; return ( <div> <Header title={"write new diary"} leftChild={<Button onClick={()=>nav(-1)} text={"< back"}/>} /> <Editor onSubmit={onSubmit}/> </div> ); }; export default New; usePageTitle.jsx import { useEffect } from "react"; const usePageTitle=(title)=>{ useEffect(()=>{ const $title=document.getElementByTagName("title")[0]; $title.innerText=title; },[title]); }; export default usePageTitle; 이전 과정까지는 문제없었는데 12.18에 있는 새일기 쓰기 페이지에 들어왔을 때 페이지에 아무것도 뜨지 않는 문제가 발생하는데 어떤게 문제일까요

  • javascript
  • react
  • node.js
진성원 댓글 2 좋아요 0 조회수 109

주피터 노트북 마우스 스크롤? 오류

해결됨

[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)

안녕하세요. 강의와 관련 없는 질문 죄송합니다. 하지만 너무 불편한데다가 도저히 해결 방법을 찾을 수 없어서 여쭤봅니다. 주피터 노트북에서 화면을 밑으로 내리는데 위 영상과 같이 자꾸 위로 튀는(?) 현상이 나타납니다. 스크롤바로 화면을 내려도 같은 현상입니다. 캐시삭제, 재부팅 등 챗gpt가 알려준 조치를 했지만 개선되지 않아 여쭙니다..

  • python
  • 웹-크롤링
  • 주피터노트북
guddbs7763 댓글 2 좋아요 0 조회수 1617

해당 강의에서 말하는 정상흐름이 어떤걸 의미하시는걸까요?

미해결

스프링 MVC 2편 - 백엔드 웹 개발 활용 기술

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? ( 예 /아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? ( 예 /아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? ( 예 /아니오) [질문 내용] 10:56 쯤 정상흐름으로 바뀌었다고 하셨는데, 이게 예외 발생 시 막.. ExceptionResolver들에 의해 처리되거나 WAS한테 아예 예외가 넘어가거나 등등 예외에 대한 흐름으로 이어져야 하는데. 마치 예외가 발생하지 않은 것 처럼 즉, 요청 성공시의 흐름으로 바뀐다는 의미인가요? 정상 흐름의 정확한 의미를 잘 모르겠습니다 ㅠㅠ

  • spring
  • mvc
댓글 1 좋아요 0 조회수 88

20:15 함수와 재귀함수

해결됨

(2026 최신!) 일주일만에 합격하는 정보처리기사 실기

문자길이값에 Hello, world! 13이라하셨는데 0부터 세는게 아니고 1부터 세는 건가요? 값구할때 0부터 시작이라고 한것같은데 문자길이에선 다른가요?

  • python
  • java
  • c
  • 정보처리기사
리안 댓글 1 좋아요 0 조회수 96

실습 코드 있을까요?

미해결

처음 만난 리액트(React)

안녕하세요 감사하게도 강의 잘 듣고있습니다. 혹시 실습한 코드를 받을 수 있는 git 있을까요? 개발환경 버전이 달라서 그런지 챕터6하는데 원치않게 동작하는게 있어서요

  • HTML/CSS
  • javascript
  • react
호호하하 댓글 2 좋아요 1 조회수 231

단축키 질문입니다.

미해결

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

DTO와 인증 서비스 2분 33초에서 35초 사이에 코드가 갑자기 생기는데요. 혹시 어떤 단축키 눌른건지 알 수 있을까요? Alt + Insert 눌러도 super까지 포함된 메소드는 나오지 않아서요. public MemberDTO(String email, String pw, String nickname, boolean social, List<String> roleNames) { super( email, pw, roleNames.stream().map(str -> new SimpleGrantedAuthority("ROLE_"+str)).collect(Collectors.toList())); this.email = email; this.pw = pw; this.nickname = nickname; this.social = social; this.roleNames = roleNames; }

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

ResponsStatusException 클래스를 이용한 에러 처리 문의

미해결

스프링 MVC 2편 - 백엔드 웹 개발 활용 기술

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? ( 예 /아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? ( 예 /아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? ( 예 /아니오) [질문 내용] ResponsStatusException 클래스를 언제 쓰는건지 잘 모르겠습니다. 강의 예제에서 다음과 같은 코드를 작성하셨습니다. ```java @GetMapping("/api/response-status-ex2") public String responseStatus{ throw new ResponseStatusException(HttpStatus.NOT_FOUND,"error.bad", new IllegalArgumentException); } ``` ResponseStatusException 클래스를 사용하는 이유를 잘 모르겠습니다. IllegalArgumentException을 직접 컨트롤할 경우 code와 message를 변경할 수 없으니까 ResponseStatusException 클래스를 사용하는게 맞나요? 그리고 실제로는 IllegalArgumentException이 발생하지 않았는데, api/response-status-ex2 로 요청을 보냈을 뿐이고 실제로 예외가 발생한 것도 아닌데, illegalArgumentException 예외를 던지는 매커니즘이 이해가 안갑니다....

  • spring
  • mvc
수하 댓글 2 좋아요 0 조회수 147

서비스계층과 컨트롤러(3) 질문있습니다.

미해결

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

서비스계층과 컨트롤러(3)-상품수정 5분 42초에서 uuid값은 화면쪽에서 처리되면서 붙는다는게 무슨 의미인지 알 수 있을까요? @Override public void modify(ProductDTO productDTO) { //step1 read Optional<Product> result = productRepository.findById(productDTO.getPno()); Product product = result.orElseThrow(); //change pname, pdesc, price product.changeName(productDTO.getPname()); product.changeDesc(productDTO.getPdesc()); product.changePrice(productDTO.getPrice()); product.changeKeyword(product.getKeyword()); //upload File -- clear first 내용이 있을 수도 있기 때문에. product.clearList(); List<String> uploadFileNames = productDTO.getUploadFileNames(); if(uploadFileNames != null && uploadFileNames.size() > 0 ){ uploadFileNames.stream().forEach(uploadName -> { product.addImageString(uploadName); }); } productRepository.save(product); } CustomFileUtil에서 saveFiles메소드에서 List<String> uploadNames = new ArrayList<>(); 배열을 선언하고 ProductServiceImp에서는 product.clearList();로 있던 배열에서 내용을 지우면서 사용하는데요. CustomFileUtil클래스 에서 데이터 베이스 1행에 저장할 리스트 생성해주고 그 리스트를 수정하는 역할이 product.clearList(); 인가요?

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
zzzzz 댓글 2 좋아요 0 조회수 70

router.replace를 하는데 setCurrent에서 변경한 상태가 유지?

미해결

Next + React Query로 SNS 서비스 만들기

라우터가 이동하면 상태가 초기화 됐던걸로 아는데, setCurrent는 왜 계속 유지가 되나요? 쉘로우 라우팅도 아닌데,,, 제가 잘못알고있나요?

  • react
  • next.js
  • react-query
  • next-auth
  • msw
트릴 댓글 2 좋아요 0 조회수 184

인기 태그

인프런 TOP Writers

주간 인기글