Skip to content

Commit

Permalink
refactor: 패키지 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
chaewon121 committed Oct 10, 2023
1 parent ef44a00 commit ee3455f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import web.org.springframework.web.WebApplicationInitializer;
import webmvc.org.springframework.web.servlet.mvc.DispatcherServlet;
import webmvc.org.springframework.web.servlet.mvc.tobe.AnnotationHandlerMapping;
import webmvc.org.springframework.web.servlet.mvc.tobe.HandlerExecutionHandlerAdapter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
@Controller
public class LogoutController {

@RequestMapping(value = "/logout", method = RequestMethod.POST)
public ModelAndView logout(final HttpServletRequest request,
final HttpServletResponse response) {
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ModelAndView logout(HttpServletRequest request, HttpServletResponse response) {
final var session = request.getSession();
session.removeAttribute(UserSession.SESSION_KEY);
return new ModelAndView(new JspView("redirect:/"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techcourse;
package webmvc.org.springframework.web.servlet.mvc;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
Expand All @@ -8,8 +8,6 @@
import org.slf4j.LoggerFactory;
import webmvc.org.springframework.web.servlet.ModelAndView;
import webmvc.org.springframework.web.servlet.View;
import webmvc.org.springframework.web.servlet.mvc.HandlerAdapter;
import webmvc.org.springframework.web.servlet.mvc.HandlerMapping;

public class DispatcherServlet extends HttpServlet {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package com.techcourse;

import jakarta.annotation.Nonnull;
import webmvc.org.springframework.web.servlet.mvc.HandlerAdapter;
package webmvc.org.springframework.web.servlet.mvc;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -14,7 +11,6 @@ public void addHandlerAdapter(HandlerAdapter handlerAdapter) {
handlerAdapters.add(handlerAdapter);
}

@Nonnull
public HandlerAdapter getHandlerAdapter(Object handler) {
return handlerAdapters.stream()
.filter(adapter -> adapter.supports(handler))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.techcourse;
package webmvc.org.springframework.web.servlet.mvc;

import jakarta.annotation.Nonnull;
import jakarta.servlet.http.HttpServletRequest;
import webmvc.org.springframework.web.servlet.mvc.HandlerMapping;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -16,7 +14,6 @@ public void initializeEach() {
handlerMappings.forEach(HandlerMapping::initialize);
}

@Nonnull
public Object getHandler(HttpServletRequest request) {
return handlerMappings.stream()
.map(handlerMapping -> handlerMapping.getHandler(request))
Expand Down

0 comments on commit ee3455f

Please sign in to comment.