-
Notifications
You must be signed in to change notification settings - Fork 388
[1-2단계 톰캣 구현하기] 비토(오상훈) 미션 제출합니다. #526
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
31 commits
Select commit
Hold shift + click to select a range
0570af3
chore: 학습 테스트 완료
unifolio0 74b6cba
feat: 1단계 구현
unifolio0 0327a97
feat: login 성공 시 index.html로 redirect 구현
unifolio0 2f07450
feat: login 성공 시 쿠키 설정하는 기능
unifolio0 a16adfa
feat: 쿠키가 있을 시 자동 로그인 기능 구현
unifolio0 fed02f6
fix: remove implementation logback-classic on gradle (#501)
geoje 7e91356
fix: add threads min-spare configuration on properties (#502)
geoje 1f85158
refactor: HttpRequest 클래스 분리
unifolio0 3666831
refactor: 메서드 분리
unifolio0 95f3203
refactor: 메서드 분리
unifolio0 e0adfe5
refactor: Controller 분리
unifolio0 5e975b0
refactor: 불필요한 코드 삭제
unifolio0 450414b
refactor: 불필요한 코드 삭제
unifolio0 15e8bfb
refactor: 메서드명 수정
unifolio0 8dc6953
refactor: requestLine 파싱 로직 이동
unifolio0 2e1b394
chore: 학습 테스트 완료
unifolio0 a3b0989
feat: 1단계 구현
unifolio0 70e07ce
feat: login 성공 시 index.html로 redirect 구현
unifolio0 d36c2f6
feat: login 성공 시 쿠키 설정하는 기능
unifolio0 9dd932d
feat: 쿠키가 있을 시 자동 로그인 기능 구현
unifolio0 640b619
refactor: HttpRequest 클래스 분리
unifolio0 f015d37
refactor: 메서드 분리
unifolio0 c36e04a
refactor: 메서드 분리
unifolio0 7fa779c
refactor: Controller 분리
unifolio0 2f23bfc
refactor: 불필요한 코드 삭제
unifolio0 8dc940e
refactor: 불필요한 코드 삭제
unifolio0 43cb5ba
refactor: 메서드명 수정
unifolio0 2b068a4
refactor: requestLine 파싱 로직 이동
unifolio0 5c9de83
Merge remote-tracking branch 'origin/step1' into step1
unifolio0 0d10b58
feat: 학습 테스트 통과
unifolio0 0b35ac0
refactor: 주석 삭제
unifolio0 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
5 changes: 5 additions & 0 deletions
5
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,18 @@ | ||
| package cache.com.example.cachecontrol; | ||
|
|
||
| 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 interceptor = new WebContentInterceptor(); | ||
| interceptor.addCacheMapping(CacheControl.noCache().cachePrivate(), "/"); | ||
| registry.addInterceptor(interceptor); | ||
| } | ||
| } |
17 changes: 13 additions & 4 deletions
17
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,21 @@ | ||
| 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<>(); | ||
| filterRegistrationBean.setFilter(new ShallowEtagHeaderFilter()); | ||
| filterRegistrationBean.addUrlPatterns("/*"); // 모든 URL 패턴에 대해 적용 | ||
| filterRegistrationBean.setName("etagFilter"); | ||
| filterRegistrationBean.setOrder(1); // 필터 순서 설정 | ||
|
|
||
| return filterRegistrationBean; | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <!DOCTYPE HTML> | ||
| <html lang="ko"> | ||
| <head> | ||
| <title>Getting Started: Serving Web Content</title> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
| </head> | ||
| <body> | ||
| Hello, World! | ||
| </body> | ||
| </html> |
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,11 @@ | ||
| <!DOCTYPE HTML> | ||
| <html lang="ko"> | ||
| <head> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
| <script src="{{staticUrls '/js/index.js'}}"></script> | ||
| <title>Document</title> | ||
| </head> | ||
| <body> | ||
| html > head > script 태그의 src에 version 디렉터리가 생겼다. | ||
| </body> | ||
| </html> |
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
32 changes: 32 additions & 0 deletions
32
tomcat/src/main/java/org/apache/coyote/http11/ContentType.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,32 @@ | ||
| package org.apache.coyote.http11; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| public enum ContentType { | ||
|
|
||
| CSS("text/css;charset=utf-8", "css"), | ||
| JS("application/javascript;charset=utf-8", "js"), | ||
| HTML("text/html;charset=utf-8", "html"), | ||
| PNG("image/png", "png"), | ||
| JPG("image/jpeg", "jpeg") | ||
| ; | ||
|
|
||
| private final String contentType; | ||
| private final String extention; | ||
|
|
||
| ContentType(String contentType, String extention) { | ||
| this.contentType = contentType; | ||
| this.extention = extention; | ||
| } | ||
|
|
||
| public String getContentType() { | ||
| return contentType; | ||
| } | ||
|
|
||
| public static ContentType getContentType(String extention) { | ||
| return Arrays.stream(values()) | ||
| .filter(contentType1 -> contentType1.extention.equals(extention)) | ||
| .findAny() | ||
| .orElseThrow(); | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extension!