문씨네프로젝트

  • 홈
  • 태그
  • 방명록

spring boot 2

[React, Spring Boot] Whitelabel Error Page문제

문제 React를 spring boot와 같이 war 파일로 말아 올렸을 때 문제 발생 원인 스프링 프로젝트는 구동하면 처음에 무조건 resources/static의 index.html 파일을 찾는다 react는 index.html이 실행된 후 라우터가 해당 페이지에서 논리적으로 페이지를 로딩 => 계속해서 index.html을 사용하며 떠나지는 않는다 스프링 위에서 리액트를 실행했기 때문에 URL 매핑에서 이동하려는 페이지(html)를 찾아야 하는데 이게 없기 때문에 에러를 발생 해결 package 기존 프로젝트 패키지명; import org.springframework.boot.web.servlet.error.ErrorController; import org.springframework.stereot..

React 2023.09.07

[React, Spring Boot] 파일 다운로드(Blob)

파일 다운로드 : DB에 있는 원본 BLOB 데이터를 가져와 화면에서 다운로드 React const downloadFile = async (event, doc) => { event.preventDefault(); const downloadUrl = '다운로드 url' const result = await axios.get(downloadUrl, {responseType : 'blob'}) // responseType 중요 let blob = new Blob([result.data], { type: result.headers['content-type'] }) let link = document.createElement('a') link.href = window.URL.createObjectURL(blob)..

React 2023.09.07
이전
1
다음
더보기
프로필사진

  • 분류 전체보기 (25)
    • Vue (1)
    • React (10)
    • Spring Boot (0)
    • Redis (0)
    • 알고리즘 풀이 (14)
      • leetcode (14)
      • 프로그래머스 (0)
      • softeer (0)

Tag

proxy, react, setState, Blob, JavasScript, TypeScript, array, react hook, spring boot, 파일 다운로드, leetcode, Queue, flusySync, Whitelabel, error, 코딩테스트, lightweight-charts, JavaScript, TradingVIew, JS,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바