전체 글
-
[SpringBoot Error] java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 에러 해결하기Backend/Spring 2022. 8. 18. 16:48
Problem 스프링에서 데이터베이스를 사용하기 위해 datasource bean 등록하며 JDBC설정을 해주어 mysql을 연동하였다. 코드는 다음과 같다. url, username, password를 설정하고 HikariDatasource 사용하도록 하였다. @Bean public DataSource dataSource() { var dataSource = DataSourceBuilder.create() .url("jdbc:mysql://localhost/order_mgmt") .username("root") .password("0000") .type(HikariDataSource.class) .build(); dataSource.setMaximumPoolSize(1000); dataSource.se..
-
[Spring] SPA와 CORS에 대해서Backend/Spring 2022. 8. 17. 17:17
SPA (Single-Page Application) 단일 페이지 웹 어플리케이션 사용자 인터랙션에 의해 URL 변경 시 화면 전체의 로드가 없이 화면의 일부분만 동적으로 렌더링하여 데스크탑 어플리케이션과 비슷한 유저 경험을 제공한다. AJAX를 이용해서 대부분의 리소스(HTML, CSS, Script)들은 어플리케이션 로드시 한번 읽는다. JSON과 같은 데이터만 어플리케이션 실행 중에 읽어오고 관련된 화면을 변경시킨다. 전통적인 방법 JSP와 Thymeleaf와 다르게 보여지는 내용을 서버에서 처리하지 않고 브라우저에서 처리하는 것 요청을 보내면 html을 반환해서 이를 렌더링함 SPA 방법 화면에서 변경이 일어날 때 DOM을 이용해서 동적으로 브라우저에서 그리는 것 요청을 해서 처음에 HTML이 로..
-
[SW 아카데미 모각코] 6주차 활동 정리모여서 각자 코딩/2022 SW 아카데미 모각코 2022. 8. 12. 17:26
일시 : 8월 12일 금 13:00 ~ 16:00 [ Google Meet ] Spring Boot - Thymeleaf 스프링부트의 타임리프를 프로젝트에 적용해보고 표현식을 학습하며 Controller 작성 및 thymeleaf를 사용한 View 생성을 진행했다. https://miraekwak.tistory.com/117 [Spring Boot] Spring Boot에서 Thymeleaf 사용하기 Thymeleaf란? 타임리프란 템플릿 엔진으로 흔히 뷰 템플릿이라고 부른다. Spring MVC 설계 시에 Controller가 전달하는 모델의 데이터를 이용하여 동적으로 화면을 구성할 수 있도록 View를 만들 수 있게 miraekwak.tistory.com Git Repository https://gi..
-
[Spring Boot] Spring Boot에서 Thymeleaf 사용하기Backend/Spring 2022. 8. 12. 17:23
Thymeleaf란? 타임리프란 템플릿 엔진으로 흔히 뷰 템플릿이라고 부른다. Spring MVC 설계 시에 Controller가 전달하는 모델의 데이터를 이용하여 동적으로 화면을 구성할 수 있도록 View를 만들 수 있게 해준다. 타임리프는 html 태그를 기반으로 하고 여기에 th:속성을 이용하여 동적인 View를 제공한다. Dependency 추가 Maven의 경우 pom.xml에 다음을 추가하여 사용할 수 있다. org.springframework.boot spring-boot-starter-thymeleaf ViewResolver 등록 ApplcationContext에서 WebMvcConfigurer 인터페이스에 구현된 configureViewResolvers함수로 resolver를 등록한다. ..
-
[SW 아카데미 모각코] 5주차 활동 정리모여서 각자 코딩/2022 SW 아카데미 모각코 2022. 8. 5. 15:58
일시 : 8월 5일 금 13:00 ~ 16:00 [ Google Meet ] Spring Boot - EmbeddedDatabase 적용 시 에러 해결 https://miraekwak.tistory.com/115 [Spring Error] EmbeddedDatabase 사용 시 java.lang.RuntimeException: mysql start failed with error 해결 Error JUnit을 사용한 스프링 부트 테스트 시에 EmbeddedDatabase를 사용해 mysql을 연결하려고 했다. @Configuration @ComponentScan( basePackages= {"org.prgrms.kdt.customer"} ) static class Config{ @Bean.. miraekw..