Spring

Spring

@Controller와 @RestController,(cannot resolve mvc view 'index')

@Controller : view 를 반환 하기 위해 사용 @RestController : @Controller + @ResponseBody, 주로 JSON 형대로 객체 데이터를 전달 하기 위함 @Controller 에선 ViewResolver가 return 에 적힌 (ex return "test") default 주소 인 template에서 test.html을 찾는다. @RestController 는 ViewResolver 가 아닌 HttpMessageConverter가 동작해 반환 데이터에 따라 MappingJackson2HttpMessageConver(객체), StringHttpMessageConverter(문자열) 가 동작하여 데이터를 전달함. (cannot resolve mvc view 'ind..

Spring

Spring 윈도우 에서 build 하는 법

1. cmd 켜기(git bash나 powershell 가능) 2. cd 해당 디렉토리 경로 3. gradlew.bat 명령어 실행 4. Build Successful 문구 확인 시 gradlew build 명령어 실행 5. Build Successful 문구 나오면 빌드 성공 6. cd build/libs (linux/gitbash/powershell) 혹은 dir build/libs (dos cmd) 7. java -jar 해당jar파일명.jar 명령어 실행 8. 성공 시 spring 로고가 뜨면 성공 ps. 빌드 오류시 대부분 현재 환경 변수로 설정된 JDK와 해당 프로젝트에서 사용하는 자바 JDK 버전이 다를 경우 에러가 뜬다(IDE설정) build.gradle에서 sourceCompatibili..

synclair
'Spring' 카테고리의 글 목록 (4 Page)