For example I have a servlet code that sets attribute to a HttpServletRequest:
request.setAttribute(\"someValue\", someValue());
RequestDispatcher rd
I'm not sure what this has to do with it being thread safe.
The exception you're getting is a NullPointerException it looks like Tomcat is trying to invoke a method on a null object.
In a Java web application each request has its own HttpServletRequest instance, so you can set the attributes on the request and be confident it is only for that user.