Spring 설정관련(7)
-
Spring 에서 WEB-INF 하위 경로 못찾는 경우
MAC으로 생성한 프로젝트를 Git으로 받아서 데탑에서돌렸다(데탑은 Window) 근데 자꾸 404 에러가 떠서 이유를 찾고 삽질을해보니 여기에서 bootRun으로 실행하면 해결된다고 한다 bootRun으로 실행 시 하위폴더까지 전체 검색이 된다고한다. 자세한내용은 나중에 공부하련다
2023.05.09 -
MyBatis 및 Mapper 경로 설정
src.main.java.yun.study. controller BoardController @GetMapping ("/board") public String boardTest(Model model){ model.addAttribute("cnt",service.boardCount()); // model.addAttribute("test",service.boardList()); return "boards/board"; } service BoardService @Service @RequiredArgsConstructor public class BoardService { private final BoardMapper boardMapper; public int boardCount(){return boardMap..
2023.01.03 -
마이바티스 연결 오류
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]:..
2023.01.02 -
Spring Boot Maven + JSP 부트스트랩 적용
결론은 : bootstrap은 resources/satatic , WEB-INF/views/include 폴더 생성 후 hearder 생성. 부트스트랩을 적용해보려고한다. JSP프로젝트이기에 WEB-INF 쪽에 BootStrap 파일들을 넣어주고 import 해주면 된다고 생각을했으나, thymeleaf와 마찬가지로 main/resurces/static에 넣어주어야 한다. 괜히 한시간동안 삽질했다. 이래서 초기 셋팅 및 환경을 여러번 잡아봐야 하나보다. views/include 폴더를 만들고 hearder.js 파일을 만들고 전체적으로 import해줬다. header.jsp 불필요한 부분들 삭제해야하나(태그라던지....) 이 부트스트랩은 import했을때 node.js 가 없어서 그런지 영문 모르는 오류..
2022.12.30 -
IntelliJ Spring 부트 서버 재실행 없이 실시간 반영하기
개발 환경 IntelliJ + spring boot + gradle 혹은 IntelliJ + spring boot + maven build.gradle dependencies { developmentOnly("org.springframework.boot:spring-boot-devtools") } pom.xml org.springframework.boot spring-boot-devtools Registry 변경 shift를 두번 눌러 검색창을 띄운 후 registry설정에 들어간다. compiler.automake.allow.when.app.running을 체크하면 된다. registry application.properties 설정 추가 resources 폴더 안에 있는 application.prop..
2022.12.30 -
Spring Boot JSP 설정
JSP 파일 경로 생성 src/main/webapp/WEB-INF/views/ 안에 board.jsp파일 생성 application.properties 의 경우 spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp application.yml 의 경우 spring: mvc: view: prefix: /WEB-INF/views/ suffix: .jsp 추가 pom.xml에 추가 의존성 추가 jstl jsp를 사용 할 수 있도록 하는 의존성 패키지 tomcat-embed-sasper
2022.12.30