UBUNTU / CATATAN</>↗Ubuntu12 Jun 2024
In Java 17, the Locale for Indonesia changed from in_ID to id_ID. In my project, the resource bundle files are named with the suffix _in.properties which is unrecognized by Java 17. To resolve this issue, I need to create copies of these resource bundle files that ends with _id.properties. Here are solutions for both Linux/macOS […]
LOGGING / CATATAN</>↗Logging08 Jun 2024
When creating a program in Java, we are mostly, if not always, add logging mechanism in our program. This log can be use to add debug information to our program, which can help us when problem occurs in our program. We usually add log message to the start of our methods to show the value […]
JAVA DATE TIME API / CATATAN</>↗Java Date Time API20 Mei 2024
Java provides different ways to determine if a certain date falls within a specified range. In this article, we’ll look at examples using the old java.util.Date and java.util.Calendar classes, as well as the newer Java Date Time API. Using java.util.Date and java.util.Calendar Before Java 8, you’d have to use Date or Calendar to work with […]
SERVLET / CATATAN</>↗Servlet17 Apr 2024
The CookieFilter class in this example is a servlet filter. Servlet filters in Java web applications are used to perform tasks such as request/response modification, authentication, logging, and more. In the context of managing cookies, a CookieFilter can be used to intercept requests and responses to handle cookie-related operations, such as setting secure attributes on […]
SERVLET / CATATAN</>↗Servlet17 Apr 2024
To configure secure cookies using web.xml, you typically need to set the secure attribute on your cookie definitions. This ensures that the cookie is only sent over HTTPS connections, enhancing security by protecting sensitive information from being transmitted over unencrypted channels. Here’s how you can do it: 1. Define Your Servlet Filter (Optional but Recommended): […]
ITEXT PDF / CATATAN</>↗iText PDF15 Mar 2024
In the following example we are going to create a table with multiple header. We will create table header with columns that spans in multiple columns and rows. Here are the steps: Create a PdfWriter object called writer with the output filename. Create a PpdfDocument object called pdf, and pass the writer object as parameter. […]