JAVA DATE TIME API / NOTES</>↗Java Date Time API20 May 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 / NOTES</>↗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 / NOTES</>↗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 / NOTES</>↗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. […]
ITEXT PDF / NOTES</>↗iText PDF10 Mar 2024
In this example you’ll see how to add Image to a Table when creating a PDF document using iText 8. We start by finding the image resource using getResource() method and pass the absolute path to the resource name. The getResource() method return a java.net.URL object. With this URL object in hand we then create […]
ANDROID MISC / NOTES</>↗Android Misc11 Feb 2024
I was trying to run Android Studio Emulator on my old 13-inch Mid 2012 MacBook Pro (Mac OS X Catalina, version 10.15.7). Every time I tried to start a Virtual Device it failed to start, it crashed all the time. Checking the idea.log, which located at $HOME/Library/Logs/Google/AndroidStudio2023.1/, give me some hints. The log tells me […]