본문 바로가기

intellij +springboot

(49)
[intellij] 그래들 스프링부트 프로젝트 화면으로 데이터 가져오기(gradle + springboot) - 4 이번 글에서는 화면에서 디비에 접근해서 데이터를 가져와보려 합니다. 데이터는 임시로 넣어놨습니다 테스트를 위한 버튼 메인 페이지 입니다. gogo ++ ajax 사용법 더보기 $.ajax({ type: "post", global: true, async: true, url: "ajax_request.php", dataType : "html", timeout: 30000, cache: true, data: {"id":"1", "mode":"write"}, contentType : "application/x-www-form-urlencoded; charset=utf-8", error: function (jqXHR, textStatus, errorThrown) { // 통신에 에러가 있을경우 처리할 내용(생략가..
[intellij]그래들 스프링부트 프로젝트 쿼리 적용 해보기(gradle + springboot) - 3 이번 글은 디비에 접근하는 코드 입니다. mybatiseconfig 다시 셋팅 여기서 이걸로 변경해 준다. 마바 콘피그 셋팅은 다른 곳에서 참고한거라 정확히 알진 못하지만 basePackages 에 패키지명만 신경써주면 될것 같다 package com.example3.demo3.config; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.facto..
[intellij]그래들 스프링부트 프로젝트 MariaDB 연결(gradle + springboot) - 2 이번글은 MariaDB 연동입니다. 우선 필요한 폴더들을 만듭니다. 자바 패키지명 아래 config, controller, dao, dto, service 각자 편한 이름 붙혀서 만들어 주세요 그리고 디폴트 페이지 index 로 연결돼 있지만 컨트롤러를 통해 내가 원하는 페이지로 이동 시키기 위해 main 으로 셋팅 했습니다. package com.example3.demo3.controller; // 패키지명 주의 import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @Controller //..
[intellij]그래들 스프링부트 프로젝트 시작하기(gradle + springboot) - 1 지금까지 혼자 해본건 메이븐 빌드도구를 사용하다가 그래들이 요즘 추세라는 얘기를 들어서 처음으로 그래들로 프로젝트 시작해보려 한다. 최대한 복붙없이 초기설정부터 차근차근 시작해보자 1. spring Initializr 탭 에서 자바버전을 선택해주고 Next (11버전을 사용하고 싶었지만 서버쪽에 다운받아놓은게 1.8버전이라 1.8 버전 선택함) 2. 아래 항목을 선택 또는 입력한다 - Group: GroupId는 자신의 프로젝트를 식별해주는 고유 아이디이다. 보통 URL의 역순 형태이다. - Artifact: 버전이 없는 jar 파일의 이름, 프로젝트 이름으로도 쓰인다 - Type: 빌드관리도구 (gradle, maven) - Language: 언어 - Packaging: 배포파일 타입 (jar, war..
[mediumtext (Types#LONGVARCHAR)], but expecting [varchar(255) (Types#VARCHAR)] le to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [column_name] in table [TableName]; found [mediumtext (Types#LONGVARCHAR)], but expecting [varchar(255) (Types#VARCHAR)] 대용량 텍스트를 추가해야돼서 varcahr 에서 mediumtext 로 칼람 데이터 타입을 변경했더니 생긴 에러 찾아보니 jpa 에서는 mediumtext 같이 긴 문자열을 쓰려면 따로..
[React 에러 일지] Cannot read properties of undefined... Uncaught TypeError: Cannot read properties of undefined (reading 'filter') 자바스크립트 에러 Top 10 🚫 Top 10 JavaScript errors from 1000+ projects (and how to avoid them) Uncaught TypeError: Cannot read property ... TypeError: ‘undefined’ is not an object ... TypeError: null is not an object ... (unknown): Script error TypeError: Object doesn’t support property TypeError: ‘undefined’ is not a function U..
Unexpected use of 'location' no-restricted-globals eslint - 명시적 전역 변수 react 예제를 분석하는 중 clone받은 소스에서는 에러가 나지 않았던 부분인데, 새로 만든 프로젝트에서는 ESLint상에서 에러가 발생하는 걸 발견했다. location이나 history 같은 전역 변수를 ESLint가 참조할 수 있게 주석으로 명시해 주는 것이다. 같은 eslint-config-airbnb-base 패키지를 사용하지만 예제 프로젝트는 v15.1.0이고 내가 설치한 최신 버전은 v16.1.0 이었다. v15.1.0로 설치하고 나니 에러가 사라졌다. 만약 v16.1.0을 사용한다고 하면 eslintrc 설정에 다음 rule을 추가하면 된다. "no-restricted-globals": ["off"] 파일에 주석으로 eslint rule을 변경해주는 방..
Unable to load class named [io.jsonwebtoken.impl.DefaultHeader] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found. Have you remembered to include the jjwt-impl.jar in yo.. Unable to load class named [io.jsonwebtoken.impl.DefaultHeader] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found. Have you remembered to include the jjwt-impl.jar in your runtime classpath? 로그인 잘 되다가 토큰 생성하는 곳에서 갑자기 에러가 터졌다 찾아보니 .. Springboot에 jwt를 연결하여 토큰을 발급받으려고 하는데 오류가 났다. io.jsonwebtoken.lang.UnknownClassExcept..