Spring 7

[Spring]7. 게시판 실습

Spring_07_게시판 실습 project 생성 시 dependencies 설정 DevTools: 수정사항이 생기면 Tomcat을 자동으로 재시작하는 도구 -자동재시작: 내용을 수정하면 자동으로 서버 재시작 기능 수행 -ReLoad: resource 내용이 변경되면 자동으로 새로고침 기능 수행 sqlDeveloper에서 board2 테이블 생성하기 [Board]entity 필드 및 생성자 만들기 [BoardWrite] 파일선택하는 input 태그 추가 form 태그에 enctype을 multipart/form-data로 지정 [BoardController] 첫 화면 메인페이지 실행 게시글 작성 페이지로 이동 게시글 저장하는 메소드 @RequestPart annotation으로 file 태그 name값으..

Spring 2023.09.21

[Spring]6. Spring Boot&React 연동

Spring_06_Spring Boot&리액트 연동 [sqlDeveloper에서 mysql 사용하기] Mysql Community 다운로드-sqlDeveloper 폴더에 넣기 https://dev.mysql.com/downloads/connector/j/8.0.html [sqlDeveloper] Oracle 환경설정-데이터베이스-타사 JDBC 드라이버-항목추가-Mysql.jar파일 선택 *mysql 파일 경로: C:\Users\smhrd\Desktop\sqldeveloper-23.1.0.097.1607- no-jre\sqldeveloper MySQL로 데이터베이스 접속 데이터 베이스 선택 Player 테이블 생성 선수정보 삽입 [Spring Boot] [PlayerController] @RestContr..

Spring 2023.09.20

[Spring]5. Spring Boot

Spring_05_Spring Boot [회원가입, 아이디중복확인, 회원조회 실습] [환경설정] Spring Tools 4 from Eclipse: 4.19.1 (windowsx86_64) https://spring.io/tools Boot Dashboard: Tomcat 내장 Create New Spring Starter Project: Name, Type, Group, Package 변경 Dependencies: [pom.xml]에 자동으로 작성됨 -Spring Boot에서 자동으로 버전관리를 해주기 때문에 버전에 대한 태그는 없음 [SpringBoot 구조] *Spring Boot에서는 view의 역할로 jsp 대신 Thymeleaf를 사용함 [SpringBoot1Application] 현재 클래스..

Spring 2023.09.15

[Spring]4. Ajax 비동기 통신

Spring_04_비동기통신(Ajax) [BoardWrite]작성한 게시글을 Ajax방식으로 BoardMain으로 보내기 비동기 통신 함수를 실행할 버튼 생성: , 태그 끝난 위치에 작성 2. form태그에 작성된 값을 가져와서 Ajax 방식으로 요청 데이터 보내기 serialize 함수로 form 태그에 작성된 값 가져오기 ajax로 요청 데이터 보내기: 요청경로, 요청데이터, 요청방식, callback 함수 작성 [BoardController] @ResponseBody: Controller에서 데이터만 응답하고 싶을 때 사용하는 annotation @RequestMapping에서 한글인코딩(produces) Ajax로 보낸 데이터 매개변수에 Board 형태로 받아오기 작성한 게시글 DB에 저장하기: ..

Spring 2023.09.14

[Spring]3. Spring Legacy 템플릿

Spring_03_Spring Legacy 템플릿 [Spring 템플릿 사용하기] spring 프로젝트 만들기: new-other-Spring Legacy Project controller 패키지 만들기: kr.board.[controller]→ [ ] context path [context root 변경]Web Project Settings [web.xml]java-→Java로 변경 [Spring 디렉토리 구조] [서버 등록] 프로젝트를 서버탭으로 드래그앤드롭 2. 톰캣 modules에서 프로젝트 등록 [spring 환경설정] 1~25번 [pom.xml] S1. Spring version: 5.0.2 버전으로 변경, java version: 1.8 버전으로 변경 S2. JDK version: 1.8 버..

Spring 2023.09.11

[Spring]2. 게시판 조회 및 삭제 실습

Spring_02_게시판 조회 및 삭제실습 [BoardMain.jsp] 제목 클릭 시 BoardDetailController로 이동하면서 게시글 번호 전송(게시글 구별) [HandlerMapping] BoardDetailController key&value Hashmap에 추가 [BoardDetailController] BoardMain에서 보낸 게시글 번호 받아오기 [BoardDAO] 게시글 세부내용 조회하는 메소드 작성(selectOne) -BoardDetailController에서 보낸 게시글 번호 받아오기 [Mapper] 게시글 세부내용 조회하는 메소드: 게시글번호에 맞는 게시글 정보만 가져오기 [BoardDetailController] BoardDAO의 getDetail 메소드에 게시글 번호 보..

Spring 2023.09.09

[Spring]1. Spring 개요

Spring_01_Spring 개요 [Spring 환경설정] eGovFrame(표준프레임워크 포털) https://www.egovframe.go.kr/home/main.do 개발자 교육-교육자료-표준프레임워크 개발자 교육 교재 및 실습 for Win (V4.0.0) Spring Legacy를 사용해야 하므로 4.0.0 버전을 다운받음 압축 풀기: C 드라이브로 변경 C 드라이브 eGovFrame 폴더 생성 확인 Spring Eclipse 실행 기본 프로젝트 삭제: delete from disk 체크 JDK 적용: window-preferences-installed JREs tomcat 적용: window-preferences-Runtime Environments window-preferences: web..

Spring 2023.09.06