-
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 구현하기] 호티(윤주호) 미션 제출합니다. (#563)
* test: 학습 테스트 수행 * feat: GET /index.html 응답하기 * refactor: CSS 지원하기 전 페이지 응답 uri 수정 * refactor: RequestLine 추출 메서드 분리 * docs: Tomcat 구현하기 1단계 기능 명세 정리 * feat: CSS 지원하기 * feat: Query String 파싱 * refactor: Servlet Container 구성 * docs: Tomcat 구현하기 2단계 기능 명세 정리 * feat: HTTP Status Code 302 * feat: POST 방식으로 회원가입 * feat: Cookie에 JSESSIONID 값 저장하기 * feat: Session 구현하기 * test: HTTP 활용하기 학습 테스트 * fix: remove implementation logback-classic on gradle (#501) (cherry picked from commit fed02f6) * fix: add threads min-spare configuration on properties (#502) (cherry picked from commit 7e91356) * refactor: http 패키지 분리 * refactor: 메서드 분리 * refactor: 패키지 분리 * refactor: 헤더 추출 로직 가독성 향상 도모 * fix: 페이지 요청 시 화면 깨짐 수정 * refactor: 불필요한 정적 팩토리 메서드 삭제 * refactor: 정적 페이지 호출 메서드 분리 * fix: 이전 쿠키 삭제 후 재발행 로직 추가 * refactor: 정적 리소스 URL 반환 메서드 분리 * refactor: 중복 로직 메서드 분리 --------- Co-authored-by: Gyeongho Yang <[email protected]>
- Loading branch information
Showing
22 changed files
with
653 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
2 changes: 2 additions & 0 deletions
2
study/src/main/java/cache/com/example/GreetingController.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
14 changes: 14 additions & 0 deletions
14
study/src/main/java/cache/com/example/cachecontrol/CacheControlInterceptor.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,14 @@ | ||
package cache.com.example.cachecontrol; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
|
||
import org.springframework.web.servlet.HandlerInterceptor; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
public class CacheControlInterceptor implements HandlerInterceptor { | ||
@Override | ||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { | ||
response.setHeader("Cache-Control", "no-cache, private"); | ||
} | ||
} |
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
13 changes: 9 additions & 4 deletions
13
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,17 @@ | ||
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", "/resources/*"); | ||
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
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 |
---|---|---|
|
@@ -8,3 +8,6 @@ server: | |
threads: | ||
min-spare: 2 | ||
max: 2 | ||
compression: | ||
enabled: true | ||
min-response-size: 10 |
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
Oops, something went wrong.