-
Notifications
You must be signed in to change notification settings - Fork 310
[1 -2단계 - Tomcat 구현하기] 리비(이근희) 미션 제출합니다. #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
d5601be
test: 파일 테스트 학습
Libienz 3be2f0c
feat: UncheckedServletExceptiona 생성 로직 추가
Libienz 1b91e01
feat: HttpRequest 구현
Libienz 271e20a
feat: HttpRequest 속성 getter 작성
Libienz 2254cc4
feat: HttpRequestHandler 명세 작성
Libienz 3225cea
feat: index.html 정적 리소스 서빙 구현
Libienz 5c5c3b7
refactor: 싱글톤 Dispatcher로 요청을 처리하도록 개선
Libienz 8517c2d
feat: 파일 확장자 얻어오는 util 기능 구현
Libienz d6d8297
refactor: 정적 리소스 ContentType 지정 개선 및 Handler가 Response 타입을 바로 반환하도록 개선
Libienz 319482d
refactor: 정적 파일을 한 줄씩 읽지 않고 한번에 읽도록 개선
Libienz b4233cb
feat: RequestLine 클래스 작성
Libienz fad4dcd
feat: RequestLine 클래스 getter 추가
Libienz 62ae5af
refactor: HttpRequest 속성 RequestLine으로 응집 개선
Libienz 4ec6d1e
feat: HttpProtocol Enum 클래스 작성
Libienz 67764a5
refactor: HttpProtocol 원시값 포장 개선
Libienz 6bd193e
fix: StaticResourceHandler 지원 조건 RequestLine에 맞게 수정
Libienz 19d993e
feat: GreetingHandler 구현
Libienz d1becc7
refactor: Uri 클래스 구현을 통한 RequestLine 속성들의 추상화 준위 통일
Libienz 6c5d8fc
feat: LoginPageHandler 구현
Libienz ee1564a
feat: QueryString 추출 기능 구현
Libienz 3f2b8e2
feat: LoginHandler 구현
Libienz 6df3de4
refactor: 패키지 구조 개선
Libienz 24aefb4
feat: 로그인 기능 구현
Libienz 274a4a9
feat: 회원가입 페이지 서비스 기능 구현
Libienz fed02f6
fix: remove implementation logback-classic on gradle (#501)
geoje 7e91356
fix: add threads min-spare configuration on properties (#502)
geoje cbd88b7
feat: 회원가입 기능 구현
Libienz 1d5fd41
refactor: HttpMessage 공통 요소 원시값 포장 개선
Libienz 06f25d5
refactor: Request의 HttpMessage 공통 요소로 포장된 객체를 사용하도록 개선
Libienz b133e2e
feat: 로그인 성공시 쿠키 설정 기능 구현
Libienz c69646c
feat: 세션 클래스 작성
Libienz fdd3837
feat: main 브랜치 병합
Libienz 8088bbd
test: 캐시 관련 학습테스트 작성
Libienz 9b0930e
feat: 세션을 통한 로그인 상태 유지 구현
Libienz 3fec0b0
refactor: 로그인 요청을 POST로 개선
Libienz e28f2bf
feat: 헤더 순서를 LinkedHashMap으로 고정
Libienz 15c5319
test: loginPage요청 응답 테스트 및 registerPage응답 테스트 작성
Libienz 3c490e0
test: login 포스트 요청 성공 실패 케이스 테스트 작성
Libienz 70154f4
fix: 로그인 실패 응답 401 statusCode 이용하도록 수정
Libienz 8498462
test: 회원가입 테스트 작성
Libienz 0a17fd0
refactor: 핸들러 매핑 조건 support 가독성 향상 개선
Libienz f6854ca
refactor: 일관되지 않은 파라미터 불변성 처리 개선 및 사용하지 않는 메서드 제거 개선
Libienz eba8f7c
refactor: 핸들러 매핑 순서가 보장되도록 스트림 개선
Libienz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
8 changes: 8 additions & 0 deletions
8
study/src/main/java/cache/com/example/cachecontrol/CacheWebConfig.java
This file contains hidden or 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,13 +1,21 @@ | ||
package cache.com.example.cachecontrol; | ||
|
||
import java.time.Duration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.CacheControl; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
import org.springframework.web.servlet.mvc.WebContentInterceptor; | ||
|
||
@Configuration | ||
public class CacheWebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addInterceptors(final InterceptorRegistry registry) { | ||
WebContentInterceptor webContentInterceptor = new WebContentInterceptor(); | ||
webContentInterceptor.addCacheMapping(CacheControl.noCache().cachePrivate(), "/"); | ||
webContentInterceptor.addCacheMapping(CacheControl.maxAge(Duration.ofDays(365)).cachePublic(), "/resources/**"); | ||
|
||
registry.addInterceptor(webContentInterceptor); | ||
} | ||
} |
15 changes: 11 additions & 4 deletions
15
study/src/main/java/cache/com/example/etag/EtagFilterConfiguration.java
This file contains hidden or 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,19 @@ | ||
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> registrationBean = new FilterRegistrationBean<>(); | ||
registrationBean.setFilter(new ShallowEtagHeaderFilter()); | ||
registrationBean.addUrlPatterns("/etag"); | ||
registrationBean.addUrlPatterns("/resources/*"); | ||
return registrationBean; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
study/src/main/java/cache/com/example/version/ResourceVersion.java
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
26 changes: 26 additions & 0 deletions
26
tomcat/src/main/java/com/techcourse/controller/GreetingController.java
This file contains hidden or 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,26 @@ | ||
package com.techcourse.controller; | ||
|
||
import java.io.IOException; | ||
import org.apache.coyote.http11.HttpProtocol; | ||
import org.apache.coyote.http11.HttpRequestHandler; | ||
import org.apache.coyote.http11.request.HttpRequest; | ||
import org.apache.coyote.http11.request.line.Method; | ||
import org.apache.coyote.http11.response.HttpResponse; | ||
|
||
public class GreetingController implements HttpRequestHandler { | ||
|
||
private static final Method SUPPORTING_METHOD = Method.GET; | ||
private static final HttpProtocol SUPPORTING_PROTOCOL = HttpProtocol.HTTP_11; | ||
|
||
@Override | ||
public boolean supports(HttpRequest request) { | ||
return request.methodEquals(SUPPORTING_METHOD) && | ||
request.protocolEquals(SUPPORTING_PROTOCOL) && | ||
request.isUriHome(); | ||
} | ||
|
||
@Override | ||
public HttpResponse handle(HttpRequest request) throws IOException { | ||
return HttpResponse.ok("Hello world!", "html"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.