-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1-2단계 Tomcat 구현하기] 산초(나영서) 미션 제출합니다. (#573)
* fix: remove implementation logback-classic on gradle (#501) * fix: add threads min-spare configuration on properties (#502) * test: FileTest 작성 * test: IOStreamTest 작성 * feat: index.html 응답하기 * refactor: import 문 정렬 - 우테코 컨벤션에 맞게 * refactor: inputStreamReader 를 사용하도록 변경 * feat: 정상 응답, 예외 응답 생성 함수 추가 * test: / 경로에 대한 테스트, 잘못된 경로에 대한 테스트 추가 * style: 코드 재정렬 * feat: 파일확장자->contentType 변환 클래스 생성 * refactor: 응답 생성 객체 분리 * refactor: 분리한 객체의 함수 호출하도록 수정 * refactor: 경로와 쿼리스트링 분리 * refactor: 정적 파일 반환 로직을 클래스로 분리 * refactor: NotFound 응답 반환로직을 함수로 생성 * feat: HTTP Request 클래스 생성 * feat: 정적 파일 요청인지 구분하는 클래스 생성 * refactor: 함수 분리 및 가독성 개선 * refactor: 함수 분리 * refactor: 패키지 변경 * refactor: 함수 이름 변경 * feat: 컨트롤러 추상 클래스 생성 * feat: 요청에 매칭되는 컨트롤러 반환 로직 구현 * feat: ModelAndView 객체 생성 * feat: LogInController 생성 * refactor: 컨틀롤러 매핑을 사용하도록 수정 * style: 개행 * fix: 오류 수정 * refactor: 클래스 이름 변경 * refactor: Http Request, Body 분리 * refactor: 패키지 이동 * refactor: RequestHeader 가 사용되던 곳을 Request 로 대체 * refactor: 가독성 개선 - 개행, 함수 이름 변경, 필드 선언 * refactor: 가독성 개선 및 레코드로 변경 * feat: 객체에 toMap 함수 추가 * feat: 로그인 실패시 401 응답 반환 기능 구현 * feat: 로그인 method 를 post 로 변경 * refactor: 오타 수정 * feat: HTTP Response 객체 생성 * style: 개행 및 안쓰는 함수 제거 * feat: RequestBody 내용을 String 이 아니라 Map 으로 변경 * feat: HttpResponse 변경 내용 적용 * feat: 비밀번호 틀린 경우 리다이렉트 * refactor: 구구 대체 * refactor: 학습 테스트 정적 파일 위치 변경 * feat: 모든 응답에 no-cache 붙이는 인터셉터 추가 * feat: 회원가입 컨트롤러 생성 * fix: 인코딩 문제 해결 * feat: 세션, 세션 메니저 객체 생성 * feat: 로그인, 회원가입 시 세션 저장 * feat: 로그인, 회원가입 시 SetCookie 헤더 설정 * feat: 로그인한 유저는 리다이렉트하는 기능 추가 * feat: 응답 압축 설정 * feat: 특정 경로에 대해 etag를 응답하도록 설정 * feat: 정적 파일 요청시 etag 응답 * refactor: 루트 경로에 대해 no cache 하도록 수정 * feat: 정적 파일에 대해 캐시 만료 시간 설정 * refactor: 오타 수정 * refactor: 시간을 etag 버전으로 설정 * refactor: 파일 확장자 추가 * chore: 사용하지 않는 클래스 삭제 --------- Co-authored-by: Gyeongho Yang <[email protected]>
- Loading branch information
Showing
32 changed files
with
730 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
study/src/main/java/cache/com/example/cachecontrol/NoCacheInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cache.com.example.cachecontrol; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.web.servlet.HandlerInterceptor; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
public class NoCacheInterceptor implements HandlerInterceptor { | ||
|
||
@Override | ||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, | ||
@Nullable ModelAndView modelAndView) throws Exception { | ||
response.setHeader("Cache-Control", "no-cache, private"); | ||
} | ||
} |
14 changes: 10 additions & 4 deletions
14
study/src/main/java/cache/com/example/etag/EtagFilterConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package cache.com.example.etag; | ||
|
||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.filter.ShallowEtagHeaderFilter; | ||
|
||
@Configuration | ||
public class EtagFilterConfiguration { | ||
|
||
// @Bean | ||
// public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() { | ||
// return null; | ||
// } | ||
@Bean | ||
public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() { | ||
FilterRegistrationBean<ShallowEtagHeaderFilter> filterRegistrationBean | ||
= new FilterRegistrationBean<>(new ShallowEtagHeaderFilter()); | ||
filterRegistrationBean.addUrlPatterns("/etag/*"); | ||
return filterRegistrationBean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
tomcat/src/main/java/org/apache/coyote/controller/Controller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.apache.coyote.controller; | ||
|
||
import org.apache.coyote.http11.HttpRequest; | ||
import org.apache.coyote.http11.HttpResponse; | ||
|
||
public abstract class Controller { | ||
|
||
public abstract HttpResponse process(HttpRequest request); | ||
} |
Oops, something went wrong.