Language/Springboot

Language/Springboot

[Springboot] Jsoup 이용하여 웹 크롤링하기

전체 파일 경로 크롤링 할 사이트 탐색하기 build.gradle 의존성 추가 News.class 파일 작성 NewsService.class 파일 작성 MainController.java 파일 수정 news.html 파일 작성 크롤링 성공 화면 Jsoup이란? - HTML을 가져오고 파싱할 수 있게 도와주는 자바 라이브러리이며, 자바에서 간단하게 크롤링 및 파싱이 가능 1. 전체 파일 경로 2. 크롤링 할 사이트 탐색하기 준비물1: 크롤링 할 사이트 주소 - https://www.hkbs.co.kr/news/articleList.html?sc_section_code=S1N1&view_type=sm 준비물2 : 크롤링 할 사이트 html 구조 및 가져올 데이터 확인 - section 의 ul li 안에 필..

Language/Springboot

[Springboot] 회원 정보(닉네임) 수정하기 (+추가 기능 구현 중)

1. UserUpdateForm 엔티티 작성 2. UserController.java 작성 3. UserService.java 작성 4. user_form.html 작성 1. UserUpdateForm 엔티티 작성 - 회원가입을 해줬을 때 만들어줬던 방식과 같이 UserUpdateForm.java 를 작성 파일 경로 : com.mysite.sbb/user/UserUpdateForm.java import lombok.Getter; import lombok.Setter; import javax.validation.constraints.NotEmpty; @Getter @Setter public class UserUpdateForm { @NotEmpty(message = "닉네임은 필수항목입니다.") priva..

Language/Springboot

[Stringboot] 네이버지도 API에 현재 위치 받아오기

1. 참고 사이트 링크 1. HTML 파일에 코드 추가 2. 완성 화면 0. 참고 사이트 링크 https://navermaps.github.io/maps.js/docs/tutorial-6-map-geolocation.example.html NAVER Maps API v3 NAVER Maps API v3로 여러분의 지도를 만들어 보세요. 유용한 기술문서와 다양한 예제 코드를 제공합니다. navermaps.github.io 1. HTML 파일에 코드 추가 var map = new naver.maps.Map('map', { center: new naver.maps.LatLng(37.5666805, 126.9784147), zoom: 10, mapTypeId: naver.maps.MapTypeId.NORMAL ..

Language/Springboot

[Stringboot] 제이쿼리(jQuery) 적용하기

1. 제이쿼리 다운로드 2. html 코드 추가 1. 제이쿼리 다운로드 링크 : https://jquery.com/download/ Download jQuery | jQuery link Downloading jQuery Compressed and uncompressed copies of jQuery files are available. The uncompressed file is best used during development or debugging; the compressed file saves bandwidth and improves performance in production. You can also download jquery.com - compressed production jQuery 3..

Language/Springboot

[Springboot] 웹에 네이버지도 API 추가하기

1. 네이버클라우드 가입 및 결제수단 등록 2. 콘솔에서 어플리케이션 추가 3. 웹에 지도 표시 4. 완성 화면 1. 네이버클라우드 가입 및 결제수단 등록 - 네이버맵 API는 결제수단을 등록해야 사용이 가능하다 플랫폼 링크 : https://www.ncloud.com/product/applicationService/maps NAVER CLOUD PLATFORM cloud computing services for corporations, IaaS, PaaS, SaaS, with Global region and Security Technology Certification www.ncloud.com 2. 콘솔에서 어플리케이션 추가 - Web Dynamic Map 체크 - Web 서비스 URL에 임시로 loc..

Language/Springboot

[Stringboot] 게시글 댓글 페이징 기능 구현하기

1. 레포지토리 작성 2. 서비스 작성 3. 컨트롤러 작성 4. HTML 작성 5. 완성 화면 1. 레포지토리 작성 - JPA Paging 사용 - 댓글 레포지토리에 question과 pageable를 아규먼트로 넣어줌 파일 경로 : com.mysite.sbb/answer/AnswerRepository.java public interface AnswerRepository extends JpaRepository { Page findAllByQuestion(Question question, Pageable pageable); } 2. 서비스 작성 - PageRequest 사용 방법 참고하여 작성 - 3개씩 끊어서 페이징 파일 경로 : com.mysite.sbb/answer/AnswerService.java ..

Language/Springboot

[Springboot] 게시글 조회수 구현하기

1. 엔티티 추가 2. 서비스 작성 3. html 작성 4. 완성 화면 1. 엔티티 추가 - 조회수를 나타낼 엔티티 추가 파일 경로 : com.mysite.sbb/question/question.java @Column(columnDefinition = "integer default 0", nullable = false) private Integer views; 2. 서비스 작성 - questionViews는 question을 불러옴 - question을 불러올 때마다 Views를 가져와서 1씩 더해주고 레포지토리에 저장함 파일 경로 : com.mysite.sbb/question/questionService.java public Question getQuestion(Integer id){ Optional ..

Language/Springboot

[Springboot] 게시글 이전글 다음글 쿼리(Oracle) 및 구현하기 (+8/27 수정)

1. 엔티티 생성 2. 레포지토리 생성 및 쿼리문 작성 3. 서비스 작성 4. 컨트롤러 작성 5. html 작성 6. 완성 화면 1. Entity 생성 - 이전 페이지와 다음 페이지의 데이터를 담을 엔티티 작성 파일 경로 : com.mysite.sbb.question/QuestionPage.java @Data @Entity public class QuestionPage { @Id private Integer id; private String PREVID; private String PREV_SUB; private String NEXTID; private String NEXT_SUB; } 2. 레포지토리 인터페이스 생성 및 쿼리문 작성 - LAG 함수 : 기준 데이터의 이전 행의 값을 반환해주는 함수 - ..

rame
'Language/Springboot' 카테고리의 글 목록