简体   繁体   中英

How to access Servlet Session in CXF Interceptor?

I have an "in" CXF Interceptor, I want to access the the Servlet Session in its handleMessage() method. My Interceptor extends AbstractPhaseInterceptor .

I want to access the session to store some info about the user as my web service client maintains sessions.

I can already access the session in my web services.

You should be able to do

HttpServletRequest req = (HttpServletRequest)message.get("HTTP.REQUEST");

to get the HttpServletReqest where you can then grab the session from it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM