servlet中传递 request

在servlet中,如果要把request传到一个线程中去,可能会抛空指针

 

To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown.

 

因为主线程已经 commit response, 而子线程可能还在继续跑

你可能感兴趣的:(servlet)