What Is a Servlet Filter?

Servlets are Java classes which handle a client’s request. Servlets are used to process HTTP requests and to generate HTTP responses. What is a Servlet Filter? A Servlet filter provides a way to modify the request or response before it is handled by the servlet, or after the servlet has generated it. Why would you want to modify the request or response? There are many reasons to modify the request or response, such as: ...

June 4, 2024 · 5 min · 883 words · In-Jun Hwang

Getting to Know Authentication Methods (Cookies, Sessions, JWTs)

Authentication/Authorization Authentication: Verifying who a user is. Authorization: Granting a user specific permissions. HTTP Features Statelessness: A feature where the client and server sever their connection after making a request and receiving a response. Request/Response: The server forgets the client’s information after the request and response cycle is complete. These features necessitate additional configurations for implementing services requiring authentication. Cookie A small piece of data that the server sends to the client. ...

June 2, 2024 · 7 min · 1304 words · In-Jun Hwang

Baekjoon 27440: Make it One 3 (C++)

This is a solution to Baekjoon 27440: Make it One 3 problem in C++. Problem Statement There are three operations that can be applied to an integer X: If X is divisible by 3, divide it by 3. If X is even, divide it by 2. Subtract 1 from X. Given an integer N, you want to make it 1 using the three operations above. Find the minimum number of operations required. ...

May 29, 2024 · 3 min · 442 words · In-Jun Hwang

Adjusting Git Commit Times

Introduction There may be situations where you need to adjust the time of a Git commit. For example: Organizing commit history across different time zones Maintaining a chronological commit history of a project Adjusting timestamps of restored code from a backup However, adjusting commit times should be done with caution, especially in collaborative projects. Methods to Adjust Commit Times 1. Specify Time When Creating a New Commit When creating a new commit, you can specify a specific time: ...

May 25, 2024 · 2 min · 370 words · In-Jun Hwang

Spring Boot Development Guide: Component-based Development Order and Best Practices

Core Components of Spring Boot Applications Let’s explore the main components and their roles involved in developing Spring Boot applications: 1. Entity An object that maps to a database table. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false) private String username; @Column(nullable = false) private String email; // getter, setter, constructor } 2. Repository An interface that handles database operations. ...

May 25, 2024 · 3 min · 488 words · In-Jun Hwang