본문 바로가기

Java190

9.13 스프링 부트 강의 시작 컨트롤러에서 리턴값으로 문자를 반환하면 viewResolver가 화면을 찾아서 처리한다. ex) return : hello -> templates/hello.html (Thymeleaf 템플릿 엔진처리) @ResponseBody 를 사용하면 HTTP의 BODY에 문자 내용을 직접 반환 viewResolver 대신에 HttpMessageConverter 가 동작 기본 문자처리: StringHttpMessageConverter 기본 객체처리: MappingJackson2HttpMessageConverter byte 처리 등등 기타 여러 HttpMessageConverter가 기본으로 등록되어 있음 2023. 9. 13.
인텔리 j 세팅에서 plugin에서 lombok 추가, thymeleaf 추가 MAVEN 홈페이지에서 추가 (가져올때 gradle(short)로 가져옴) Spring Boot DevTools » 2.7.15 템플릿 엔진 사용 설정 Thymeleaf Layout Dialect 추가 타임리프 뷰 페이지 기본 경로 : templates 타임리프 사용 시 html 문서에 추가 2023. 8. 31.
SpringBoot 설치 Spring Tools 4 for Eclipse (sts사이트에서 설치) boot bersion 3점대 버전은 java17이상만 사용가능 SNAPSHOT : 개발중 # EclipseMarketplace : eclipse web Developer tools 설치 -> web 설정 UTF-8로 바꾸기 # springBoot에서는 기본적으로 jsp파일 지원x jsp 해석하는 jasper lib 필요함. https://start.spring.io/ 프로젝트를 만들어주는 사이트 *** sec 프로젝트 참고하기 mybtis lib 추가 시 database 설정 정보 없으면 실행 안됨. aplication.properties에 아래 내용 작성 \# server.port 설정 server.port=8081 \# dat.. 2023. 8. 29.
채팅구현 - 웹소켓통신 참고 : mvc_security_template pom.xml org.springframework spring-websocket ${org.springframework-version} root-context.xml에 등록 (이때 path가 SockJS 객체 생성시에 들어가는 url 요청 경로임) 1.ChatHandler 클래스 생성. public class ChatHandler extends TextWebSocketHandler { 메소드 : handleTextMessage : client에서 메세지 받으면 실행되는 메소드. .sendMessage : 클라이언트로 메세지를 보내는 메소드 2. 실제 자바스크립트로 jsp페이지에서 사용.(chat.jsp) ``` ``` SockJS 객체 - SockJS 생성.. 2023. 8. 28.
spring security & DB 연계 참고 : mvc_security_template join.jsp에서 multipart/form-data라서 multipartResolver가 변환해줌 filter-resolver-servlet순서인데 security filter가 먼저 확인해서 token 없구나 라고 인식해버린다. -> filter 추가 등록 필요 springMultipartFilter org.springframework.web.multipart.support.MultipartFilter springMultipartFilter /* filterMultipartResolver 라고 root-context.xml에서 resolver 이름 변경(이름은 고정임) org.springframework.security spring-security-t.. 2023. 8. 28.
SPRING SECURITY 보안프레임워크 MAVEN 라이브러리 추가 pom.xml 11 5.3.29 5.8.6 1.9.19 2.0.7 org.springframework.security spring-security-core ${security-version} org.springframework.security spring-security-web ${security-version} org.springframework.security spring-security-config ${security-version} core,web,config 다 있어야 함. web.xml springSecurityFilterChain org.springframework.web.filter.DelegatingFilterProxy springSecurityFilterCha.. 2023. 8. 25.