Mr.Humorous 🥘

Nothing is impossible, the word itself says 'I'm possible'❗️ 💪

Session Attributes in Spring MVC

Understanding Session Attributes in Spring MVC

1. Overview When developing web applications, we often need to refer to the same attributes in several views. For example, we may have shopping cart contents that need to be displayed on multiple ...

Difference between application/x-www-form-urlencoded and multipart/form-data in HTTP/HTML?

Understanding x-www-form-urlencoded and multipart/form-data

1. General Overview Recently in one of the Java web developer interview, one of my readers asked about the difference between x-www-form-url-encoded and multipart/form-data MIME types. In HTTP, th...

How Lambdas and Anonymous Inner Classes Work

Understanding Lambdas and Anonymous Inner Classes

1. Key Points Lambdas implement a functional interface. Anonymous Inner Classes can extend a class or implement an interface with any number of methods. Variables – Lambdas can only access ...

Spring Interceptor vs. Filter

Understanding the difference between spring interceptor and filter

1. Difference Overview Filter Interceptor Summary Filter 接口定义在 javax.servlet 包中 接口 HandlerInterceptor 定义在org.springframework.web.servlet 包中 ...

Java Shutdown Hook

Examples of Runtime.addShutdownHook()

Java shutdown hook are handy to run some code when program exit. We can use java.lang.Runtime.addShutdownHook(Thread t) method to add a shutdown hook in the JVM. 1. Java Shutdown Hook Java shutdo...

Java Equivalents of Malloc(), new, free(), and delete

Memory management operators in Java

1. The delete operator in Java…? Java has no direct equivalent of delete. That is, there is no call that you can make to tell the JVM to “deallocate this object”. It is up to the JVM to work out w...

Checked vs Unchecked Exceptions in Java

Understanding what checked and unchecked exceptions are

In Java, there are two types of exceptions: 1. Checked Exceptions Checked: are the exceptions that are checked at compile time. If some code within a method throws a checked exception, then the me...

Charset and Encodings

Understanding Charset and Encodings

1. Charset Charset is a combination of a coded character set and a character-encoding scheme. A character set is a defined list of characters recognized by the computer hardware and software. Each ...

Meet Apache Tomcat Catalina

Brief introduction to Apache Tomcat Catalina

1. Meet Tomcat Catalina Apache Tomcat is a widely used implementation of the Java Servlet Specification, which composes a number of components, including a Tomcat JSP engine and a variety of differ...

String Conversion in Java

Understanding explicit and automatic String conversion in Java

1. Explicit vs Automatic String Conversion Explicit String conversion ways include: Use of the toString() method of an object, especially wrapper classes. Use of the static overloaded method S...