백엔드 개발

스프링 빈을 등록하는 방법은 2가지가 있다. 1. 컴포넌트 스캔과 자동 의존관계 설정 2. 자바 코드로 직접 스프링 빈 등록하기 1. 컴포넌트 스캔과 자동 의존관계 설정 회원 컨트롤러가 회원서비스와 회원 리포지토리를 사용할 수 있게 의존관계를 준비하자. 회원 컨트롤러에 의존관계 추가 package com.example.hellospring.controller; import com.example.hellospring.service.MemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @Controller public class Mem..
1. 정적 콘텐츠 hello-static.html을 내장 톰켓 서버에 요청한다. 여기서 스프링은 먼저 hello-static 관련된 컨트롤러가 있는지 찾아본다. 없으면 resources에서 static 폴더에 hello-static.html 이 있는지 확인하고 반환해주는 것이다. 2. MVC와 템플릿 엔진 helloController에 hello-mvc가 mapping이 되는지 확인하고 그 메서드에서 hello-template로 반환한다. viewResolver(View를 찾아주고 template을 연결해주는 역할을 함)라는 곳에서 데이터를 받아서 templates 폴더에 있는 hello-template.html을 thymeleaf에 넘겨준다. 데이터를 처리하고 html을 변환한 다음 웹에 보여지게 된다..
1. 해당 프로젝트 경로로 간다. 2. './gradlew build' 명령어 실행 3. cd build/libs 4. 'java -jar 〰️〰️〰️SNAPSHOT.jar' 실행
Spring Boot DevTools는 소스 변경이 발생할 때마다 빠르게 자동 빌드해줘서 바로바로 반영 결과를 확인할 수 있도록 도와주는 유용한 툴이다. 라이브러리 사용하기 1. build.gradle 의존성 추가 dependencies { ... developmentOnly 'org.springframework.boot:spring-boot-devtools' } 코끼리 모양 눌러서 라이브러리 적용 2. intellij 설정하기 1) pereferences > Build,Execution, Deployment > Compiler > 'Build project atomatically' 체크 2) pereferences > Advanced Settings > Compiler > 'Allow auto-make..
spring 소스코드 git 주소 Recompile
이론 설명은 검색하면 다 나오니까 방법만 간단하게 ㅎ - 프로젝트를 생성할 경로로 이동 : 이동한 디렉토리에서 우클릭 -> Git Bash Here - 순서대로 명령어 입력하면 돼요 npm install express-generator -g express node_server --view=ejs : express (프로젝트명) --view=(템플릿 엔진명) => 프로젝트명 = node_server / 템플릿 엔진명 = ejs - 설치가 다 되었고 디렉터리로 가보면 node_server 라는 프로젝트가 생성되었습니다. 초간단!! 설치를 완료했으니 실행해봅시다. - 생성된 디렉터리로 이동 cd node_server - 서버 실행 명령어 입력 npm start 어.... 에러가 뜬다. http-errors 모..
태기
'백엔드 개발' 카테고리의 글 목록 (3 Page)