-
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.
[๐ฑ Tomcat ๊ตฌํํ๊ธฐ 1๋จ๊ณ] ์ ์ฐ์ค(์ ์ฌ์ฐ) ๋ฏธ์
์ ์ถํฉ๋๋ค. (#552)
* fix: remove implementation logback-classic on gradle (#501) * fix: add threads min-spare configuration on properties (#502) * fix: javax -> jakarta ๋ณ๊ฒฝํ์ฌ ์ปดํ์ผ ์๋ฌ ํด๊ฒฐ * test: FileTest ํ์ต * test: IOStreamTest ํ์ต * feat: GET `index.html` ์๋ตํ๊ธฐ * refactor: http request ํด๋์ค ๋ถ๋ฆฌ * feat: CSS ์ง์ํ๊ธฐ * feat: Query String ํ์ฑ * feat: HTTP ํ์ฉํ๊ธฐ ํ์ตํ ์คํธ * refactor: ์ฌ์ฉํ์ง ์๋ ํด๋์ค ์ญ์ --------- Co-authored-by: Gyeongho Yang <[email protected]>
- Loading branch information
Showing
18 changed files
with
408 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# ๊ธฐ๋ฅ ์๊ตฌ ์ฌํญ | ||
|
||
## 1๋จ๊ณ - HTTP ์๋ฒ ๊ตฌํํ๊ธฐ | ||
- [x] 1\. GET `index.html` ์๋ตํ๊ธฐ | ||
- [x] 2\. CSS ์ง์ํ๊ธฐ | ||
- [x] 3\. Query String ํ์ฑ |
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
21 changes: 21 additions & 0 deletions
21
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,21 @@ | ||
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 CacheControlInterceptor implements HandlerInterceptor { | ||
|
||
@Override | ||
public void postHandle( | ||
HttpServletRequest request, | ||
HttpServletResponse response, | ||
Object handler, | ||
@Nullable ModelAndView modelAndView | ||
) { | ||
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
15 changes: 11 additions & 4 deletions
15
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,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> filterRegistrationBean = new FilterRegistrationBean<>(); | ||
filterRegistrationBean.setFilter(new ShallowEtagHeaderFilter()); | ||
filterRegistrationBean.addUrlPatterns("/etag"); | ||
filterRegistrationBean.addInitParameter("tag", "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
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
Oops, something went wrong.