viewResolver

· Spring
JSP를 위한 ViewResolver 컨트롤러 처리 결과를 JSP를 이용해서 생성하기 위해 다음과 같은 설정을 사용해야 합니다. package config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import or..
· Spring
DIspatcherServlet과 스프링 컨테이너 web.xml dispatcher org.springframework.web.servlet.DispatcherServlet contextClass org.springframework.web.context.support.AnnotationConfigWebApplicationContext contextConfigLocation config.MvcConfig config.ControllerConfig 1 dispatcher / encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 encodingFilter /* 위의 web.xml 소스를 보면 DispatcherS..
· Spring
이번 포스팅에서는 스프링 MVC 핵심 구성요소에 대해 알아보겠습니다. 위 그림에서 이라고 표시한 것은 스프링 빈으로 등록해야 하는 것을 의미합니다. 그림에서 중앙에 위치한 DispatcherServlet은 모든 연결을 담당합니다. 1) 웹 브라우저 요청이 들어오면 DispatcherServlet은 모든 연결을 담당합니다. 2) 직접 컨트롤러를 검색하지 않고 HandlerMapping이라는 빈 객체에게 컨트롤러 검색을 요청합니다. HandlerMapping은 클라이언트의 요청 경로를 이용해서 이를 처리할 컨트롤러 빈 객체를 DispatcherServlet에 전달합니다. 웹 요청 경로가 "/hello" 라면 등록된 컨트롤러 빈 중에서 "/hello" 요청 경로를 처리할 컨트롤러를 리턴합니다. Dispatch..
· Spring
이번 포스팅에서는 클라이언트의 요청을 알맞게 처리할 컨트롤러와 처리 결과를 보여줄 JSP 코드를 통해 실습해 보도록 하겠습니다. 컨트롤러 구현 package chap09; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class HelloController { @GetMapping("/hello") public String hello(Model mode..
runnnerDevHong
'viewResolver' 태그의 글 목록