Just from a quick look at the Catalina Javadocs, I can't help but wonder if you're not mixing org.apache.catalina classes and
java servlet classes too casually. It looks like it's possible that a Catalina request may be castable to an unblessed (and thus possibly incomplete)
j2ee servlet request. However, there's no explicit method to go from one to the other, nor an inheritance path nor an explicit blessing for doing such a cast.
So the fact that it compiled and executed without exception may be an artifact of an undocumented internal structure, as from reading the Javadocs, I'd expect it to fail outright.
You may need to check the
Tomcat source code to see if you want to do is safe.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.