본문 바로가기
728x90

풀스택/Spring13

ViewResolver 설정 https://github.com/jeongwoohyunn/mysite3-spring- ViewResolver은 View이름을 가지고 View 오브젝트를 찾아준다. 빈 등록을 하지 않으면 전체경로를 다 적어주어야한다. 밑의 것을 넣어주어서 편하게 사용하자. spring-servlet에 넣어준다. 2019. 2. 23.
spring html, css적용 안될때 https://github.com/jeongwoohyunn/mysite3-spring- spring에서 css,html,js에 파일 접근에 실패할때 이유는 DispatchServlet이 모든 URL처리에서 매핑을 하여서 DefaultServlet에 위임을 하지 못하기 때문에 spring -servlet.xml 파일에서 이런것두 있댄다. 그냥 같이 넣어주면 좋을듯. 2019. 2. 23.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354package com.douzone.guestbook.controller; import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.ModelAttribute;import org.springframework.web.bind.annotation.P.. 2019. 2. 19.
spring 예제 emaillist->emaillist3 1. 사용자의 요청을 DispatcherServlet이 받는 다.2. 요청을 처리해야 하는 컨트롤을 찾기 위해 HandlerMapping에게 질의를 하고 HandlerMapping은 컨트롤 객체에 매핑되어 있는 URL를 찾아낸다.3. DispatcherServlet은 찾은 컨트롤에게 요청을 전달하고 Controller는 서비스 계층의 인터페이스를 호출하여 적절한 비지니스를 수행한다. 4. 컨트롤러는 비지니스 로직의 수행결과로 받아낸 도메인 모델 객체와 함께 뷰이름을 ModelAndView 객체에 저장하여 반환한다.5. DispatcherServlet은 응답할 View를 찾기 위해 ViewResolver에게 질의를 한다. 6. DispatcherServlet은 찾아낸 View 객체에게 요청을 전달한다. -.. 2019. 2. 19.