본문 바로가기
반응형
SMALL

IT/개발16

[SpringBoot] 백엔드에서 Form 데이터 받기 목적 프론트엔드(JSP)에서 백엔드(Servlet)로 Form 데이터를 전달할 때, 백엔드에서 데이터를 활용하기 위해 파라미터로 전달받음 이 때, 전달받는 방법에 여러가지가 있어서 정리함 방법 1. HttpServletRequest 이용 // HttpServletRequest @RequestMapping("/FormData1") public String FormData1(HttpServletRequest httpServletRequest, Model model){ // httpServletRequest를 이용하여 id와 pw를 가져옴 String id = httpServletRequest.getParameter("id"); String pw = httpServletRequest.getParameter(".. 2021. 9. 21.
[SpringBoot] DI(의존성 주입) 의존성 주입(Dependency Injection)이란 - 외부에서 두 객체 간의 관계를 결정해주는 디자인 패턴 - 인터페이스를 사이에 둬서 클래스 레벨에서 의존관계가 고정되지 않도록 런타임 시에 관계를 다이나믹하게 중집 예시 public Class DI{ // 강한 결합 // private로 선언되어 있어서 오류가 난다. public static void companyTest1(){ Company c1 = new Company(); } // 약한 결합 // DI로 인해 오류가 나지 않는다. public static void companyTest2(Company c){ Company c2 = c; } } class Company{ String empNo; String empName; private Com.. 2021. 9. 19.
[SpringBoot] Visual Studio Code로 Spring Boot 프로젝트 만들기 자바 개발 환경을 선택 할 때, 이클립스, STS 등 많이 사용하지만 무겁다는 단점이 있다. Visual Studio Code 줄여서 vscode는 자바 뿐만 아니라 C++, python등도 사용할 수 있고, 커뮤니티가 잘 형성되어 있어서 확장팩이 많이 존재한다. Download 1. Visual Studio Code https://code.visualstudio.com/ Visual Studio Code - Code Editing. Redefined Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is.. 2021. 9. 19.
[git] 깃 브랜치 연결 (간단사용법) in Linux 사전 설치 - WSL (Windows에서 Linux 접근) - ubuntu - git 1. git Lab 연결 sudo bash -c 'echo "192.0.0.0 gitlab~.com" >> /etc/hosts' - /etc/hosts에 gitlab 연결하는 과정 - 192.0.0.0에는 gitlab의 ip 주소 입력 2. 로컬에 git 저장 git clone http://gitlab.~ - 온라인에 있는 git 내용을 로컬에 저장하는 과정 - 저장소 이름으로 된 폴더가 생김 3. git 폴더로 이동 cd TIL - git의 TIL 저장소를 가져왔기 때문에 TIL 폴더가 만들어진다. 4. branch 확인 git branch - 기본 master branch 존재 - 그 외 branch들이 나온다. 5.. 2021. 9. 7.
반응형
LIST