Skip to content

Commit

Permalink
refactor : 프레임워크 관련 코드, mvc 패키지로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
kpeel5839 committed Sep 24, 2023
1 parent fe96f5f commit 91c41c8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.servlet.ServletContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import web.org.springframework.web.DispatcherServlet;
import web.org.springframework.web.WebApplicationInitializer;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private ModelAndView redirectAfterCheckAccount(final HttpServletRequest request,
}

@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView loginPage(final HttpServletRequest req, final HttpServletResponse res) throws Exception {
public ModelAndView loginView(final HttpServletRequest req, final HttpServletResponse res) throws Exception {
return UserSession.getUserFrom(req.getSession())
.map(user -> {
log.info("logged in {}", user.getAccount());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techcourse;
package web.org.springframework.web;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
Expand All @@ -9,6 +9,8 @@
import webmvc.org.springframework.web.servlet.ModelAndView;
import webmvc.org.springframework.web.servlet.mvc.tobe.AnnotationHandlerAdapter;
import webmvc.org.springframework.web.servlet.mvc.tobe.AnnotationHandlerMapping;
import webmvc.org.springframework.web.servlet.mvc.tobe.HandlerAdapters;
import webmvc.org.springframework.web.servlet.mvc.tobe.HandlerMappings;

public class DispatcherServlet extends HttpServlet {

Expand All @@ -31,7 +33,7 @@ public void init() {
}

@Override
protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
log.debug("Method : {}, Request URI : {}", request.getMethod(), request.getRequestURI());

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ private void putHandlerExecutionByAnnotation(Object controller, Method method) {
}
}


@Override
public Object getHandler(HttpServletRequest request) {
HandlerKey key = new HandlerKey(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.techcourse;
package webmvc.org.springframework.web.servlet.mvc.tobe;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import webmvc.org.springframework.web.servlet.ModelAndView;
import webmvc.org.springframework.web.servlet.mvc.tobe.HandlerAdapter;

public class HandlerAdapters {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.techcourse;
package webmvc.org.springframework.web.servlet.mvc.tobe;

import jakarta.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import webmvc.org.springframework.web.servlet.mvc.tobe.HandlerMapping;

public class HandlerMappings {

Expand Down

0 comments on commit 91c41c8

Please sign in to comment.