Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a008e41
refactor: 테스트에 synchronized 적용
hyeonji1220 Sep 13, 2024
4d1ddba
refactor: 테스트 결과의 스레드풀과 queue 갯수 변경
hyeonji1220 Sep 13, 2024
0c72d8b
refactor: 회원 추가에 syncronized 적용
hyeonji1220 Sep 13, 2024
0350a5b
chore: 다중 스레드 설정
hyeonji1220 Sep 13, 2024
a894c8b
refactor: 커밋 기록을 위하 넣었던 공백 제거
hyeonji1220 Sep 13, 2024
f1a4282
refactor: 쓰레드풀 적용
hyeonji1220 Sep 13, 2024
5b0809f
refactor: 동시성 컬렉션 적용
hyeonji1220 Sep 13, 2024
fb880dd
refactor: catalina, coyote 성격에 맞게 패키지 이동
hyeonji1220 Sep 15, 2024
cd1fc33
refactor: catalina, coyote 성격에 맞게 패키지 이동
hyeonji1220 Sep 16, 2024
7259fc0
refactor: request body의 파라미터를 가져오는 메서드 적용
hyeonji1220 Sep 16, 2024
0f111af
refactor: 로그인 메서드 분리
hyeonji1220 Sep 16, 2024
b195f6a
refactor: 쿠키 매핑 메서드 수정
hyeonji1220 Sep 16, 2024
4adda66
refactor: 기존 쿠키가 있는 경우만 쿠키 추가하도록 수정
hyeonji1220 Sep 16, 2024
cfdbbca
fix: 싱글톤 오류 수정
hyeonji1220 Sep 16, 2024
301298b
refactor: 오타 수정
hyeonji1220 Sep 16, 2024
cb46cc3
refactor: 상수화 적용
hyeonji1220 Sep 16, 2024
9f2d58e
refactor: 메서드 분리
hyeonji1220 Sep 16, 2024
6a82dec
refactor: 메서드 분리
hyeonji1220 Sep 16, 2024
467d2f1
refactor: 문자열 결합 로직 개선
hyeonji1220 Sep 16, 2024
79452b0
refactor: 메서드 분리
hyeonji1220 Sep 16, 2024
efa49b5
refactor: 정적 컨텐츠 처리 책임을 processor로 이동
hyeonji1220 Sep 16, 2024
30371c1
refactor: import 순서 정리
hyeonji1220 Sep 16, 2024
b00cb3f
refactor: 패키지 이동
hyeonji1220 Sep 16, 2024
5f9029f
refactor: request 객체 생성 및 기본 설정 책임을 processor로 이동
hyeonji1220 Sep 16, 2024
da88afd
refactor: dispatcher의 이름을 역할에 맞게 ServletContainer로 변경
hyeonji1220 Sep 16, 2024
a14e45e
refactor: sevletContainer가 매핑 정보를 받아 생성되도록 변경
hyeonji1220 Sep 17, 2024
065d170
refactor: body가 빈값일 때 처리 추가
hyeonji1220 Sep 17, 2024
12cbfa3
test: 부족한 테스트 추가
hyeonji1220 Sep 17, 2024
a1c6664
refac정or: 포트 수정
hyeonji1220 Sep 17, 2024
4abdea0
refactor: 선언하지 않은 httpMethod 요청이 들어왔을 경우 예외 처리
hyeonji1220 Sep 19, 2024
5c8196e
refactor: 자동으로 설정되는 상태코드 로직 중복 제거
hyeonji1220 Sep 19, 2024
476b3ba
refactor: 데이터 타입 추상화
hyeonji1220 Sep 19, 2024
c4876a0
refactor: 공백 제거 및 정렬
hyeonji1220 Sep 19, 2024
f3cdd17
refactor: 메서드 분리
hyeonji1220 Sep 19, 2024
3661793
refactor: 헤더에 세션 추가 책임 이동
hyeonji1220 Sep 19, 2024
ab53d08
refactor: 바디의 parameter 예외 추가
hyeonji1220 Sep 19, 2024
73a926c
refactor: 상수화 적용
hyeonji1220 Sep 19, 2024
d37c00f
refactor: post 오류 수정
hyeonji1220 Sep 19, 2024
1253132
refactor: 리다이렉션 오류 수정
hyeonji1220 Sep 19, 2024
026883b
refactor: unchecked 예외로 수정
hyeonji1220 Sep 20, 2024
ca007e7
refactor: redirection 오류 수정
hyeonji1220 Sep 20, 2024
3548068
refactor: redirection 오류 수정
hyeonji1220 Sep 20, 2024
a4b2479
refactor: stream 적용
hyeonji1220 Sep 20, 2024
1399174
refactor: 예외인 경우 사용자 리다이렉션 추가
hyeonji1220 Sep 20, 2024
fc50aae
test: body의 content length 테스트 속성 추가
hyeonji1220 Sep 20, 2024
310a6b8
refactor: content type 지정 책임 이동
hyeonji1220 Sep 20, 2024
0d76eca
fix: content length를 byte 단위로 수정
hyeonji1220 Sep 21, 2024
5dd2132
fix: 쿠키 중복 삽입 오류 수정
hyeonji1220 Sep 21, 2024
2b4b5ed
test: content length 테스트 수정
hyeonji1220 Sep 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion study/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ handlebars:
server:
tomcat:
accept-count: 1
max-connections: 1
max-connections: 2
Copy link

@unifolio0 unifolio0 Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문입니다!
max-connections가 무엇을 의미하나요?
왜 해당 값만 변경해도 테스트가 통과하나요?
accept-count는 테스트를 통과하는데 영향이 없나요?
☺️☺️

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max-connections는 동시에 처리할 수 있는 최대 연결수를 의미해요!
테스트에서 200을 응답하면 올라가는 count가 2어야지 통과되게 되어있기때문에
정상 처리되어야하는 연결수를 2로 바꾸어주었습니다.
accept-count는 쓰레드로 할당은 못되었지만 대기할 수 있는 대기열의 크기를 의미하므로 영향을 주지 않습니다~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#687 (comment)
해당 테스트 코드를 보면 200을 반환하는 수가 2개면 통과하도록 되어 있어요. 그러면 대기하고 있다가 처리하면 통과하는 게 맞지 않을까요? accept-count도 테스트에 영향을 미칠 수 있어요!

레벨 4가 되서 많이 바쁜 건 알지만 좀 더 학습 테스트를 활용해 보는 건 어떨까요?☺️☺️

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept-count 숫자만큼 기다리다가 타임아웃이 발생하여서 max-commections 숫자만큼만 200을 응답하는군요~ 덕분에 알아갑니다!

threads:
min-spare: 2
max: 2
Expand Down
18 changes: 7 additions & 11 deletions study/src/test/java/thread/stage0/SynchronizationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@
import org.junit.jupiter.api.Test;

/**
* 다중 스레드 환경에서 두 개 이상의 스레드가 변경 가능한(mutable) 공유 데이터를 동시에 업데이트하면 경쟁 조건(race condition)이 발생한다.
* 자바는 공유 데이터에 대한 스레드 접근을 동기화(synchronization)하여 경쟁 조건을 방지한다.
* 동기화된 블록은 하나의 스레드만 접근하여 실행할 수 있다.
*
* Synchronization
* https://docs.oracle.com/javase/tutorial/essential/concurrency/sync.html
* 다중 스레드 환경에서 두 개 이상의 스레드가 변경 가능한(mutable) 공유 데이터를 동시에 업데이트하면 경쟁 조건(race condition)이 발생한다. 자바는 공유 데이터에 대한 스레드 접근을
* 동기화(synchronization)하여 경쟁 조건을 방지한다. 동기화된 블록은 하나의 스레드만 접근하여 실행할 수 있다.
* <p>
* Synchronization https://docs.oracle.com/javase/tutorial/essential/concurrency/sync.html
*/
class SynchronizationTest {

/**
* 테스트가 성공하도록 SynchronizedMethods 클래스에 동기화를 적용해보자.
* synchronized 키워드에 대하여 찾아보고 적용하면 된다.
*
* Guide to the Synchronized Keyword in Java
* https://www.baeldung.com/java-synchronized
* 테스트가 성공하도록 SynchronizedMethods 클래스에 동기화를 적용해보자. synchronized 키워드에 대하여 찾아보고 적용하면 된다.
* <p>
* Guide to the Synchronized Keyword in Java https://www.baeldung.com/java-synchronized
*/
@Test
void testSynchronized() throws InterruptedException {
Expand Down
13 changes: 5 additions & 8 deletions study/src/test/java/thread/stage0/ThreadPoolsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import org.slf4j.LoggerFactory;

/**
* 스레드 풀은 무엇이고 어떻게 동작할까?
* 테스트를 통과시키고 왜 해당 결과가 나왔는지 생각해보자.
*
* Thread Pools
* https://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html
*
* Introduction to Thread Pools in Java
* https://www.baeldung.com/thread-pool-java-and-guava
* 스레드 풀은 무엇이고 어떻게 동작할까? 테스트를 통과시키고 왜 해당 결과가 나왔는지 생각해보자.
* <p>
* Thread Pools https://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html
* <p>
* Introduction to Thread Pools in Java https://www.baeldung.com/thread-pool-java-and-guava
*/
class ThreadPoolsTest {

Expand Down
2 changes: 1 addition & 1 deletion tomcat/src/main/java/com/techcourse/Application.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.techcourse;

import org.apache.catalina.startup.Tomcat;
import org.apache.coyote.startup.Tomcat;

public class Application {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ public class InMemoryUserRepository {

private static final Map<String, User> database = new ConcurrentHashMap<>();

static {
final User user = new User(1L, "gugu", "password", "hkkang@woowahan.com");
database.put(user.getAccount(), user);
}
private InMemoryUserRepository() {}

public static void save(User user) {
database.put(user.getAccount(), user);
Expand All @@ -23,5 +20,7 @@ public static Optional<User> findByAccount(String account) {
return Optional.ofNullable(database.get(account));
}

private InMemoryUserRepository() {}
public static void reset() {
database.clear();
}
}
20 changes: 20 additions & 0 deletions tomcat/src/main/java/org/apache/catalina/ServletContainer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.apache.catalina;

import org.apache.catalina.controller.Controller;
import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;
import org.apache.coyote.processor.ControllerMapper;

public class ServletContainer {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServletContainer라고 이름 지은 이유가 궁금해요~☺️☺️

ServletContainer가 어떤 건가요? 지금 이 클래스는 그 역할을 하고 있다고 볼 수 있나요?🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

매핑되어있는 서블릿(해당 구조에서는 컨트롤러가 서블릿 역할을 한다고 생각합니다)를 받아서, 서블릿의 실행 함수를 호출하는 역할을 하기에 서블릿 컨테이너의 역할이라고 생각했습니다~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서블릿 컨테이너는 서블릿의 실행에 관한 전반적인 영역을 다룹니다. 단순히 매핑되어 있는 걸 호출하기만 하는게 아닌 서블릿의 생명주기도 다루고 멀티 스레드를 통해 리소스도 관리해요. 대표적으로 톰켓이 서블릿 컨테이너의 예시라고 볼 수 있어요☺️☺️

지금 해당 클래스를 ServletContainer라고 부르는 게 맞는 지 다시 고민해보면 좋을 것 같아요☺️☺️

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어떤 서블릿과 연결해줄지 결정하고, 서블릿의 service 함수를 호출하는 역할을 하기에 충분히 서블릿 컨테이너라고 이름 붙일 수 있다고 생각해요~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

대표적으로 톰켓이 서블릿 컨테이너의 예시라고 볼 수 있어요☺️☺️

그럼 질문이요! 현재 해당 클래스와 Tomcat 클래스와 역할의 정도가 비슷하다고 볼 수 있나요?🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서블릿 컨테이너 = 톰캣은 아니라고 생각해요!
톰캣은 connector 역할을 갖는 coyote 부분과 서블릿 엔진(서블릿 컨테이너) 역할을 갖는 catalina 부분으로 나눠져있고
그 중 서블릿 엔진 즉, 서블릿 컨테이너 역할을 하는 부분을 이 클래스로 정의한 것입니다~
https://jiminbyun.medium.com/apache-tomcat-1-core-components-and-their-interactions-939f1f476544
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catalina (The Servlet Engine)

  • Catalina is the powerhouse of Tomcat. It’s where the real magic happens.
  • When a request arrives, Catalina decides whether it’s a servlet or a JSP (JavaServer Page). If it is a servlet, Catalina takes charge.
  • Catalina manages the lifecycle of servlets, including loading, initialization, and handling requests.

커비가 어떤 말을 하는 지는 이해했지만 그게 정말 맞는진 모르겠어요... 단순히 매핑되어 있는 걸 호출하는게 서블릿의 생명 주기를 관리하는 걸로는 받아들일 수 없을 것 같아요!☺️☺️


private final ControllerMapper controllerMapper;

public ServletContainer(ControllerMapper controllerMapper) {
this.controllerMapper = controllerMapper;
}

public void run(HttpRequest httpRequest, HttpResponse httpResponse) {
Controller controller = controllerMapper.getController(httpRequest.getPath());
controller.service(httpRequest, httpResponse);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.apache.catalina.controller;

import org.apache.catalina.http.HeaderName;
import org.apache.catalina.http.HttpMethod;
import org.apache.catalina.http.StatusCode;
import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;

public abstract class AbstractController implements Controller {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문입니다!☺️
지금 아래 doPostdoGet을 보면 abstract메소드가 아니기 때문에 이 클래스를 상속받아도 굳이 구현할 필요가 없습니다. 구현을 안 하면 여기에 있는 메소드를 사용하니까요.
그런데 여기에 있는 메소드에서는 아무런 로직이 없네요🤔

만약에 DELETE메소드를 지원하는 url이 생겨서 doDelete라는 메소드가 생겼습니다.
다만 /login은 DELETE를 지원하지 않는다고 할 때 /login을 DELETE로 호출하면 어떻게 되나요?
그 동작이 커비가 의도한 동작인가요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

예외 처리가 필요하겠네요~
구현체 컨트롤러에서 선언하지 않은 메서드의 경우 예외처리 되도록 추가했습니다!


@Override
public void service(HttpRequest request, HttpResponse response) {
try {
if (request.isMethod(HttpMethod.GET)) {
doGet(request, response);
return;
}
if (request.isMethod(HttpMethod.POST)) {
doPost(request, response);
return;
}
throw new IllegalArgumentException("HttpMethod not found");
} catch (IllegalArgumentException e) {
response.setStatusCode(StatusCode.FOUND);
response.addHeader(HeaderName.LOCATION, "/500.html");
}
}

protected void doPost(HttpRequest request, HttpResponse response) {
throw new IllegalArgumentException("HttpMethod unsupported");
}

protected void doGet(HttpRequest request, HttpResponse response) {
throw new IllegalArgumentException("HttpMethod unsupported");
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.apache.catalina.controller;

import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;

public interface Controller {

void service(HttpRequest request, HttpResponse response);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.apache.coyote.controller;
package org.apache.catalina.controller;

import org.apache.coyote.http.StatusCode;
import org.apache.coyote.request.HttpRequest;
import org.apache.coyote.response.HttpResponse;
import org.apache.catalina.http.StatusCode;
import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;

public class HomeController extends AbstractController {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package org.apache.catalina.controller;

import com.techcourse.db.InMemoryUserRepository;
import com.techcourse.model.User;
import java.util.Optional;
import org.apache.catalina.http.HeaderName;
import org.apache.catalina.http.StatusCode;
import org.apache.catalina.manager.SessionManager;
import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;

public class LoginController extends AbstractController {

private final SessionManager sessionManager;

public LoginController() {
this.sessionManager = SessionManager.getInstance();
}

@Override
protected void doPost(HttpRequest request, HttpResponse response) {
String account = request.getBodyParam("account");
String password = request.getBodyParam("password");
Comment on lines +22 to +23

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

만약 body에 해당 key값이 없으면 어떻게 되나요?🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null을 반환합니다~ 호출하는 곳에서는 Optional.empty()을 반환하게 됩니다~

Optional<User> user = InMemoryUserRepository.findByAccount(account);
if (!isMember(user, password)) {
response.setStatusCode(StatusCode.FOUND);
response.addHeader(HeaderName.LOCATION, "/401.html");

}
if (isMember(user, password)) {
response.setStatusCode(StatusCode.FOUND);
response.addHeader(HeaderName.LOCATION, "/index.html");
login(response, user.get());
}
}

private boolean isMember(Optional<User> user, String password) {
return user.isPresent() && user.get().checkPassword(password);
}

private void login(HttpResponse response, User user) {
String sessionId = sessionManager.generateSession(user);
response.addSession(sessionId);
}

@Override
protected void doGet(HttpRequest request, HttpResponse response) {
if (hasLogined(request)) {
response.setStatusCode(StatusCode.FOUND);
response.addHeader(HeaderName.LOCATION, "/index.html");
}
if (!hasLogined(request)) {
response.setStatusCode(StatusCode.OK);
response.setBody("/login.html");
}
}

private boolean hasLogined(HttpRequest request) {
return request.hasSession() && sessionManager.isSessionExist(request.getSessionId());
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package org.apache.coyote.controller;
package org.apache.catalina.controller;

import com.techcourse.db.InMemoryUserRepository;
import com.techcourse.model.User;
import org.apache.coyote.http.HeaderName;
import org.apache.coyote.http.StatusCode;
import org.apache.coyote.request.HttpRequest;
import org.apache.coyote.request.RequestBody;
import org.apache.coyote.response.HttpResponse;
import org.apache.catalina.http.HeaderName;
import org.apache.catalina.http.StatusCode;
import org.apache.catalina.request.HttpRequest;
import org.apache.catalina.response.HttpResponse;

public class RegisterController extends AbstractController {

@Override
protected void doPost(HttpRequest request, HttpResponse response) {
RequestBody requestBody = request.getBody();
String account = requestBody.get("account");
String password = requestBody.get("password");
String email = requestBody.get("email");
String account = request.getBodyParam("account");
String password = request.getBodyParam("password");
String email = request.getBodyParam("email");
Comment on lines +14 to +16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

body에 해당 key값이 들어있는지 검증이 필요하지 않을까요?🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

예외 처리를 추가해주었습니다~

InMemoryUserRepository.save(new User(account, password, email));

response.setStatusCode(StatusCode.FOUND);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package org.apache.coyote.coockie;
package org.apache.catalina.coockie;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;

public class HttpCookie {

public static final String COOKIE_DELIMITER = "; ";
public static final String COOKIE_VALUE_DELIMITER = "=";
public static final int KEY_INDEX = 0;
public static final int VALUE_INDEX = 1;
public static final int KEY_VALUE_COUNT = 2;
private static final String JSESSIONID_VALUE = "JSESSIONID";

private final Map<String, String> cookies;
Expand All @@ -19,18 +26,14 @@ public HttpCookie(String rawCookies) {
}

private static Map<String, String> mapCookies(String rawCookies) {
Map<String, String> cookieGroup = new HashMap<>();

if (rawCookies != null && !rawCookies.isBlank()) {
String[] cookiesElements = rawCookies.split("; ");
for (int i = 0; i < cookiesElements.length; i++) {
String[] cookiePair = cookiesElements[i].split("=");
if (cookiePair.length > 1) {
cookieGroup.put(cookiePair[0], cookiePair[1]);
}
}
if (rawCookies == null || rawCookies.isBlank()) {
return Map.of();
}
return cookieGroup;

return Arrays.stream(rawCookies.split(COOKIE_DELIMITER))
.map(cookie -> cookie.split(COOKIE_VALUE_DELIMITER))
.filter(cookiePair -> cookiePair.length == KEY_VALUE_COUNT)
.collect(Collectors.toMap(cookiePair -> cookiePair[KEY_INDEX], cookiePair -> cookiePair[VALUE_INDEX]));
}

public boolean hasSessionId() {
Expand All @@ -41,6 +44,10 @@ public String getSessionId() {
return cookies.get(JSESSIONID_VALUE);
}

public boolean hasCookie() {
return !cookies.isEmpty();
}

public String getResponse() {
if (cookies.isEmpty()) {
return "";
Expand All @@ -49,7 +56,7 @@ public String getResponse() {
StringBuilder response = new StringBuilder();
for (Entry<String, String> stringStringEntry : cookies.entrySet()) {
response.append(stringStringEntry.getKey())
.append("=")
.append(COOKIE_VALUE_DELIMITER)
.append(stringStringEntry.getValue())
.append(";");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.techcourse.exception;
package org.apache.catalina.exception;

public class UncheckedServletException extends RuntimeException {

public UncheckedServletException(Exception e) {
super(e);
super("UncheckedServletException occured", e);
}
}
21 changes: 21 additions & 0 deletions tomcat/src/main/java/org/apache/catalina/http/HeaderName.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.apache.catalina.http;

public enum HeaderName {
CONTENT_LENGTH("Content-Length"),
COOKIE("Cookie"),
CONTENT_TYPE("Content-Type"),
LOCATION("Location"),
SET_COOKIE("Set-Cookie"),

;

private final String value;

HeaderName(String value) {
this.value = value;
}

public String getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.apache.coyote.http;
package org.apache.catalina.http;

public enum HttpMethod {
GET,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.apache.coyote.http11;
package org.apache.catalina.http;

public enum ProtocolVersion {
HTTP1_1("HTTP/1.1"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.apache.coyote.http;
package org.apache.catalina.http;

public enum StatusCode {
OK(200, "OK"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.apache.coyote.manager;
package org.apache.catalina.manager;

import java.io.IOException;
import org.apache.coyote.session.Session;
import org.apache.catalina.session.Session;

/**
* A <b>Manager</b> manages the pool of Sessions that are associated with a
Expand Down
Loading