본문 바로가기
728x90
반응형

PROGRAMING📚/Spring📑12

서버 사이드 랜더링 방식 서버사이드 랜더링 방식 사용//쿼리메서드나, deleteById등은 한건씩 진행을 한다 //@Query 를 사용해서 update,delete 할 경우에 사용 Bulk 연선을 함 //그래서 트랜젝션을 복수개 할 것을 한번에 처리하기 때문에 //복수의 트랜잭션으 한번에 처리하기 위해 @Modifying을 사용 @Modifying @Query("delete from Review r where r.member = :member") void deleteByMember(Member member);application.properties의 역할은 프로젝트의 초기화와 같은 역할을 한다# App namespring.application.name=ex6# Server portserver.port=8080# Co.. 2024. 9. 29.
Spring / Spring boot 스프링 프레임워크는 엔터프라이즈용 Java 애플리케이션을 편리하게 개발할 수 있도록 지원하는 오픈소스 경량급 애플리케이션 프레임워크입니다. 이 프레임워크는 특정 기술이나 업무에 국한되지 않고, 애플리케이션 개발에 필요한 모든 과정을 포괄하는 특징을 가지고 있습니다. 특히, POJO(Plain Old Java Object) 프로그래밍을 지향하여 순수한 Java 객체를 활용하는 유연한 개발 방식을 제공합니다.주요 특징POJO 프로그래밍스프링은 외부 기술이나 규약에 얽매이지 않고, 순수 Java 객체로 애플리케이션을 구성할 수 있도록 지원합니다. 이를 통해 객체지향 설계를 자유롭게 적용하고 코드의 단순성을 유지하며, 테스트와 디버깅을 쉽게 할 수 있습니다.IoC / DI (Inversion of Control.. 2024. 9. 26.
Spring[EX06.코드] - 데이터 , 이미지 등록(통합구현) 페이지 안에 영화 이미지, 영화 정보에 대해서 나오도록 작업 할 예정src/main/java/com/example/ex6/service/MovieService.java 에 추가PageResultDTO getList(PageRequestDTO pageRequestDTO);default MovieDTO entityToDto(Movie movie, List movieImageList , Double avg, int reviewCnt){ MovieDTO movieDTO = MovieDTO.builder() .mno(movie.getMno()) .title(movie.getTitle()) .regDate(movie.getRegDate()) .modD.. 2024. 9. 25.
CSRF - API 서버 @RestController 대의 적인 상태를 전송함. 컨트롤러를 통해서 애플리케이션의 성격?을 알 수 있음뷰를 랜더링 하지 않고 데이터만 전송을 함 @PostMapping(value = "")데이터를 주로 보냄@GetMapping(value = "/{num}", produces = MediaType.*APPLICATION_JSON_VALUE*)전송하는 내용이 적음, ? 쿼리를 통해서 데이터를 전송함@DeleteMapping(value = "/{num}", produces = MediaType.*TEXT_PLAIN_VALUE*)삭제@PutMapping(value = "/{num}", produces = MediaType.*TEXT_PLAIN_VALUE*)업데이트 CSRF(Cross-Site Request.. 2024. 9. 25.
JSP(JavaServer Pages) JSP(JavaServer Pages)는 서버 측에서 동적으로 HTML, XML 등의 문서를 생성할 수 있는 Java 기반의 웹 기술입니다. JSP는 웹 애플리케이션을 개발할 때 주로 프런트엔드와 백엔드 간의 연결을 담당하며, HTML 코드 내에 Java 코드를 포함할 수 있는 특징을 가지고 있습니다. JSP는 서블릿(Servlet) 기술의 확장된 형태로, 서블릿보다 HTML을 더 직관적으로 작성할 수 있어 웹 페이지 개발에 많이 사용됩니다.JSP의 주요 특징동적 콘텐츠 생성:JSP는 정적인 HTML 코드에 Java 코드를 포함하여 서버에서 동적으로 콘텐츠를 생성할 수 있습니다.예를 들어, 데이터베이스에서 데이터를 불러와 웹 페이지에 표시하거나, 사용자 입력에 따라 다른 페이지를 생성할 수 있습니다.서버.. 2024. 9. 25.
Spring : 구글 로그인 세션 만들기 구글 로그인 세션 만들기https://developers.google.com/identity/sign-in/web/sign-in?hl=koOAuth 클라이언트 ID 만들기http://localhost:8080/ex7/login/oauth2/code/google  JSON 다운로드#OAuth2 includespring.profiles.include = oauth 💡 **My Additional information**spring.security.oauth2.client.registration.google.client-id=776858494674-fvo383dker0jierot3pjciiaon2lluqn.apps.googleusercontent.comspring.security.oauth2.client.r.. 2024. 9. 25.
Spring Security - USER/MANAGER/ADMIN 에 따른 권한 부여 권한은 user,MANAGER,ADMIN 으로 나누어지지만 이 모두는 Member 엔티티에 들어감 *USER*, *MANAGER*, *ADMIN*}@Configuration@EnableWebSecuritypublic class SecurityConfig { private static final String[] AUTH_WHITElIST = { "/", "/sample/all" };@Bean protected SecurityFilterChain config(HttpSecurity httpSecurity) throws Exception { // authorizeHttpRequests :: 선별적으로 접속을 제한하는 메서드 // 모든 페이지가 인증을 받도록 되어 있는 상태 .. 2024. 9. 25.
SecuritConfig -코드 해석 더보기package com.example.InstaPrj.config;import com.example.InstaPrj.security.handler.CustomAccessDeniedHandler;import com.example.InstaPrj.security.handler.CustomAuthenticationFailureHandler;import com.example.InstaPrj.security.handler.CustomLoginSuccessHandler;import com.example.InstaPrj.security.handler.CustomLogoutSuccessHandler;import org.springframework.context.annotation.Bean;import org.spr.. 2024. 9. 25.
[Spring]::Startbootstrap - Simple Sidebar 사용하기 Startbootstrap - Simple Sidebar 사용하기http://startbootstrap.com/ Start Bootstrap startbootstrap.com https://startbootstrap.com/template/simple-sidebar#google_vignette Start Bootstrap startbootstrap.com src/main/resources/templates/layout/basic.html layout 폴더 안에 basic.html 파일 생성 해주고 다운받은 bootstrap index.html 을 복사해서 넣어준다 Start Bootstrap Dashboard Shortcuts Overview Eve.. 2024. 7. 11.
[Spring]::Fragments Fragments레이아웃의 기본 공식 :  One True Layouthttps://m.blog.naver.com/wlwl16/221253244581 레이아웃의 기본공식: One true Layout모던 웹디자인을 위한 HTML+CSS 책 246쪽 1. body태그를 가운데 정렬합니다:  body { widt...blog.naver.com 새로운 폴더(fragments) 생성 -> html 파일 생성src/main/resources/templates/fragments/fragment1.html Part 1 Part 2 Part 3 src/main/resources/templates/exLayout1.html templates/sample 안에 exLayout1.html 파일 생성Fragment Te.. 2024. 7. 11.
[Spring] 타임리프(Thymeleaf ) Thymeleaf TEMPLATE ENGINESA modern server-side Java template engine for both web and standalone environments. Allows HTML to be correctly displayed in browsers and as static prototypes. 새 프로젝트 생성하기 ex3/src/main/resources/application.properties# App namespring.application.name=ex3# Server portserver.port=8080# Context pathserver.servlet.context-path=/ex3# Restart WASspring.devtools.livereload.ena.. 2024. 7. 10.
[Spring]Spring 시작하기 Spring은 구조가 중요하다https://start.spring.io/ Spring 파일을 만들기 위해서는위 사이트에서 파일을 생성 해주어야한다Gradle-Groovy 라이브러리 Maven프로젝트의 빌드/라이브러리 관리와 컴파일 관리 라이브러리 오류 발생시 Reload project 를 누르면 프로젝트를 재설정해줌 jar -웹에서 바로 컴파일war - 웹 애플리케이션 아카이브   Controller 만들기package com.example.ex1;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpubli.. 2024. 7. 9.
728x90
반응형