-
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 - 2단계] 페드로(류형욱) 미션 제출합니다. (#578)
* test(FileTest): FileTest 학습 테스트 풀이 * test(IOStreamTest): IOStreamTest 학습 테스트 풀이 * Style(StubSocket): `@Override` 어노테이션 명시 * feat: Http 요청, 응답 메시지를 관리하는 객체 구현 * feat(Http11Processor): 정적 리소스 응답 기능 구현 * feat(Http11Processor): 확장자에 따라 Content-Type을 지정하도록 변경 * feat(ApiRouter): HTTP 메서드와 Path 별 매핑 관리 객체 추가 * refactor(StaticResourceManager): 클래스명 변경 * refactor(HttpResponse): Body 설정 시 Content-Length를 자동으로 계산하도록 변경 * feat(LoginController): GET 메서드를 통한 로그인 기능 구현 * feat(RegisterController): 회원가입 페이지 응답 기능 구현 * feat(HttpRequest): Form 형태의 Body 지원 * feat(Http11Processor): UUID 형태의 JSESSIONID 쿠키 발급 기능 구현 * test: HTTP 활용하기 학습 테스트 풀이 * feat: 세션을 활용한 로그인 유지 기능 구현 * refactor(Http11Processor): Http Message Body 읽는 로직 수정
- Loading branch information
Showing
23 changed files
with
852 additions
and
140 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
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() { | ||
ShallowEtagHeaderFilter filter = new ShallowEtagHeaderFilter(); | ||
FilterRegistrationBean<ShallowEtagHeaderFilter> filterRegistrationBean = new FilterRegistrationBean<>(filter); | ||
filterRegistrationBean.addUrlPatterns("/etag"); | ||
filterRegistrationBean.addUrlPatterns("/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
27 changes: 27 additions & 0 deletions
27
study/src/main/java/cache/com/example/version/HandlebarsConfig.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,27 @@ | ||
package cache.com.example.version; | ||
|
||
import com.github.jknack.handlebars.springmvc.HandlebarsViewResolver; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.ViewResolver; | ||
|
||
@Configuration | ||
public class HandlebarsConfig { | ||
|
||
private final VersionHandlebarsHelper versionHandlebarsHelper; | ||
|
||
public HandlebarsConfig(VersionHandlebarsHelper versionHandlebarsHelper) { | ||
this.versionHandlebarsHelper = versionHandlebarsHelper; | ||
} | ||
|
||
@Bean | ||
public ViewResolver handlebarsViewResolver() { | ||
HandlebarsViewResolver viewResolver = new HandlebarsViewResolver(); | ||
viewResolver.registerHelper("staticUrls", versionHandlebarsHelper); | ||
|
||
viewResolver.setPrefix("classpath:/templates/"); | ||
viewResolver.setSuffix(".html"); | ||
|
||
return viewResolver; | ||
} | ||
} |
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.