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.