-
Notifications
You must be signed in to change notification settings - Fork 309
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
[톰캣 구현하기 - 3, 4단계] 오잉(이하늘) 미션 제출합니다. #428
Conversation
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.
오잉 코드 잘봤어요 ㅎㅎ
너무 멋집니다.
Response
를 외부에서 생성하고 넣어주는 것 외에는 커다란 흐름의 변경은 없는 것 같아요 !
개별적으로 커멘트 달아놨습니다 ㅎㅎ
다음번에 요청주시면 바로 머지해도될것같아요 고생하셨어요 ~!
tomcat/src/main/java/org/apache/coyote/http11/Http11Processor.java
Outdated
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/common/request/HttpRequest.java
Outdated
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/common/response/HttpResponse.java
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/common/response/ResponseHeaders.java
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/servlet/NotFoundServlet.java
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/servlet/RegisterServlet.java
Outdated
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/common/response/ResponseHeaders.java
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/common/response/HttpResponse.java
Show resolved
Hide resolved
안녕하세요 하디! 주요 변경지점은 다음과 같습니다.
그런데 뭔가..? Servlet 내부 코드가 좀 그렇네요.. 그리고 servlet별로 다른 allowedMethod를 어떻게 상위클래스로 넘길 수 있을지 고민하다가, 생성자에서 super로 넘겨서 세팅하는 방식을 택했는데 혹시 어떻게 생각하시나요?! |
tomcat/src/main/java/org/apache/coyote/http11/servlet/RegisterServlet.java
Outdated
Show resolved
Hide resolved
tomcat/src/main/java/org/apache/coyote/http11/servlet/Servlet.java
Outdated
Show resolved
Hide resolved
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.
오잉 고생하셨어요 !
리뷰 반영해주신거 확인했습니다 !
오잉 코드보고 많이 배워갑니다 ~~!
머지하겠습니다 ㅎㅎ
얼마전 크루에게 들은 내용인데 패키지간 의존성도 마지막으로 한 번 분석해보면 좋을 것 같아요 !
다음 미션도 화이팅 하십쇼 !!👍
tomcat/src/main/java/org/apache/coyote/http11/servlet/Servlet.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! 0 Bugs 0.0% Coverage The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
안녕하세요 하디 🕺
이번 미션 3,4단계 완료했습니다!
3단계(리팩토링)를 진행하다보니 수정사항이 꽤 많이 생겼습니다 ㅎㅎ..
Servlet
기존 Servlet의 handle메소드는 Request를 파라미터로 받아 적절한 Response를 반환했습니다.
수정 후 Servlet의 service메소드가 Request, Response를 모두 파라미터로 받고,
service 로직 속에서 response에 적절한 값을 세팅해주게 되었습니다.
MethodNotAllowedException & BadRequestException
허용하지 않는 메소드이거나 잘못된 요청인 경우 error를 발생시키고
Http11Processor에서 해당 error를 잡아 적절한 response를 세팅하도록 수정했습니다.
HttpHeaders -> RequestHeaders & ResponseHeaders
HttpRequest, HttpResponse 모두에서 사용되던 HttpHeaders를 RequestHeaders와 ResponseHeaders로 분리했습니다.
이번 리뷰도 잘 부탁드립니다!! 🙇♀️