Adding custom headers to Java HttpServletRequest
The javax.servlet.http.HttpServletRequest is an interface that does not have setter methods except for setCharacterEncoding() and setAttribute() methods that it inherits from its parent javax.servlet.ServletRequest interface. Otherwise, the HttpServletRequest type objects are read only.
Understanding Custom ThreadFactory In Java
A thread factory encapsulates the logic of creation and configuration of threads. It creates and returns thread instances on demand. You can see it being used in the JDK’s executor framework. Every thread pool has an associated thread factory that creates the threads for the pool. The thread factory not just creates thread instances but also […]