로그아웃 (로그인체크확인)
·
Framework/SPRING FRAMEWORK
로그인 처리
·
Framework/SPRING FRAMEWORK
이전 서블릿 HttpSession session = request.geSession(); Spring public String xxx(HttpSession session) {}
flash scope
·
Framework/SPRING FRAMEWORK
이전 서블릿 request scope session scope application scope 스프링 request scope flash scope ==========⇒ redirect 했는데 target에서 값을 딱 한번만 사용할 수 있다. session scope application scope 💡 기존 redirect 에서는 Model의 값을 tartget 사용 못 함 @RequestMapping("/aaa") m.addAttribute(key,value); return "redirect:target"; } flash scope의 redirect ⇒ RedirectAttributes 값을 target 사용 가능 public String xxx(RedirectAttributes m) { m.addFl..
forward / redirect
·
Framework/SPRING FRAMEWORK
이전 서블릿 redirect response.sendRedirect(”target”); 화면 URL 변경 request scope에 저장된 데이터는 target에서 사용불가 forward request.getRequestDispatcher(”target”).forward(request, response); 화면 URL 변경 안됨 request scope에 저장된 데이터는 target에서 사용 가능 스프링 redirect public String xxx( ) { return “redirect:target”; } forward public String xxx( ) { return “forward:target”; } redirect forward redirect, forward로 값 가져오기
Controller 클래스 메서드의 리턴타입
·
Framework/SPRING FRAMEWORK
@RequestMapping("/a") public String xxx( ) { } view정보o Model정보x @RequestMapping("/a") public String xxx(Model m) { } view정보o Model정보o @RequestMapping(”/a”) public ModelAndView xxx( ) { } view정보o Model정보o @RequestMapping(”/a”) public @ModelAttribute("key") LoginDTO xxx( ) { } view정보x Model정보o Spring이 뷰를 유추해서 찾음 ( 요청맵핑값으로 뷰를 찾음) (a.jsp) (/WEB-INF/views/a.jsp) @RequestMapping(”/a”) public String xx..
xoo | 수진
xoo의 성장기록