Creating WebContainerLib classes
For this module, we do not need to make any changes to the HttpRequest and HttpResponse classes created in Chapter 3. We will use their already defined structure to create our base library so that SimpleWebContainer works correctly and allows developers to create their own applications.
Let's review the structures of the HttpRequest class and the HttpResponse class.
public class HttpRequest {
private String httpMethod;
private String resourcePath;
private String messageBody;
private String fileExtension;
private String destinationHost;
private Map<String, String> urlParameters;
private Map<String, String> headers;
// getters and setters
}
public class HttpResponse {
private Integer statusCode;
private String contentType;
private Integer contentLength;
private byte[] content;
// status codes
public static final int OK = 200;
public static final int BAD_REQUEST = 400;
public...